summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Shawcroft <marcus.shawcroft@arm.com>2015-02-28 00:17:22 +0000
committerAndrew Hsieh <andrewhsieh@google.com>2015-03-30 21:39:09 -0700
commit2775e1f78a873bb908bc69ae56ed5fc2ebd74314 (patch)
tree93d3937cd90fa99ccab1811a03d91d323e0c74ce
parentf8840af184b512a05ace38a1aa0e06b3e5691d52 (diff)
downloadtoolchain_binutils-2775e1f78a873bb908bc69ae56ed5fc2ebd74314.tar.gz
toolchain_binutils-2775e1f78a873bb908bc69ae56ed5fc2ebd74314.tar.bz2
toolchain_binutils-2775e1f78a873bb908bc69ae56ed5fc2ebd74314.zip
[AArch64] Refactor section_group[] representation.
Change the behaviour of section_group[] such that .stub_sec points to the stub section attached to the indexed section rather than the stub section attached to the link_section pointed to be the index section. This provides a mechanism to get to the stub section following any input section. While still allowing the section grouping mechanism to find the section group stub section associated with an input section by first following the link_sec pointer. Change-Id: I19bce3feea77bbc71c04f2d8b3a204c527a21d9a
-rw-r--r--binutils-2.25/bfd/elfnn-aarch64.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/binutils-2.25/bfd/elfnn-aarch64.c b/binutils-2.25/bfd/elfnn-aarch64.c
index e3c91344..8d58ad57 100644
--- a/binutils-2.25/bfd/elfnn-aarch64.c
+++ b/binutils-2.25/bfd/elfnn-aarch64.c
@@ -2327,21 +2327,12 @@ _bfd_aarch64_create_or_find_stub_sec (asection *section,
link_sec = htab->stub_group[section->id].link_sec;
BFD_ASSERT (link_sec != NULL);
- stub_sec = htab->stub_group[section->id].stub_sec;
-
+ stub_sec = htab->stub_group[link_sec->id].stub_sec;
if (stub_sec == NULL)
{
- stub_sec = htab->stub_group[link_sec->id].stub_sec;
- if (stub_sec == NULL)
- {
- stub_sec = _bfd_aarch64_create_stub_section (link_sec, htab);
- if (stub_sec == NULL)
- return NULL;
- htab->stub_group[link_sec->id].stub_sec = stub_sec;
- }
- htab->stub_group[section->id].stub_sec = stub_sec;
+ stub_sec = _bfd_aarch64_create_stub_section (link_sec, htab);
+ htab->stub_group[link_sec->id].stub_sec = stub_sec;
}
-
return stub_sec;
}