From: Marcus Shawcroft Date: Sat, 28 Feb 2015 00:17:22 +0000 (+0000) Subject: Refactor section_group[] representation. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66b1c35da1be8fc46ff80b13895fead2c627fe4a;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index de425a68328..506c4dbdd18 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Marcus Shawcroft + + * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust + update of section_group[].stub_sec. + 2015-03-24 Marcus Shawcroft * elfnn-aarch64.c (struct aarch64_erratum_835769_fix) Remove. diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index e3c91344034..8d58ad57d70 100644 --- a/bfd/elfnn-aarch64.c +++ b/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; }