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] Ignore symbols defined in SHF_EXCLUDE sections


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

commit 2e84f9c1b5770b803b739bcd157d7a457c22b56f
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Aug 26 22:01:15 2016 +0930

    Ignore symbols defined in SHF_EXCLUDE sections
    
    	PR 20513
    	* ldlang.c (section_already_linked): Deal with SHF_EXCLUDE sections.

Diff:
---
 ld/ChangeLog | 5 +++++
 ld/ldlang.c  | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 83fbe7c..9ad7417 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
 2016-08-31  Alan Modra  <amodra@gmail.com>
 
+	PR 20513
+	* ldlang.c (section_already_linked): Deal with SHF_EXCLUDE sections.
+
+2016-08-31  Alan Modra  <amodra@gmail.com>
+
 	* testsuite/ld-powerpc/vle-multiseg-1.d: Adjust to suit segment change.
 	* testsuite/ld-powerpc/vle-multiseg-2.d: Likewise.
 	* testsuite/ld-powerpc/vle-multiseg-3.d: Likewise.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index aee8720..07c2182 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2294,6 +2294,12 @@ section_already_linked (bfd *abfd, asection *sec, void *data)
       return;
     }
 
+  /* Deal with SHF_EXCLUDE ELF sections.  */
+  if (!bfd_link_relocatable (&link_info)
+      && (abfd->flags & BFD_PLUGIN) == 0
+      && (sec->flags & (SEC_GROUP | SEC_KEEP | SEC_EXCLUDE)) == SEC_EXCLUDE)
+    sec->output_section = bfd_abs_section_ptr;
+
   if (!(abfd->flags & DYNAMIC))
     bfd_section_already_linked (abfd, sec, &link_info);
 }


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