This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] [AArch64] Refactor section_group[] representation.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=30068a6d2da1ba4b0248a270c7c958ef24a80416

commit 30068a6d2da1ba4b0248a270c7c958ef24a80416
Author: Marcus Shawcroft <marcus.shawcroft@arm.com>
Date:   Sat Feb 28 00:17:22 2015 +0000

    [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.

Diff:
---
 bfd/ChangeLog       |  5 +++++
 bfd/elfnn-aarch64.c | 15 +++------------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 47afb5c..07b47b1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
 2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
+	* elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust
+	update of section_group[].stub_sec.
+
+2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
 	* elfnn-aarch64.c (struct aarch64_erratum_835769_fix) Remove.
 	(erratum_835769_scan) Drop fix_table_size_p and fixes_p arguments.
 	Delete fixes, fix_table_size and associated code.  Call
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 14b4057..d5c1fd5 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -2350,21 +2350,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;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]