bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/20513] GNU ld does not ignore symbols defined in sections marked


From: hjl.tools at gmail dot com
Subject: [Bug ld/20513] GNU ld does not ignore symbols defined in sections marked EXCLUDE
Date: Fri, 26 Aug 2016 23:52:22 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=20513

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
This is better:

index e7a8dff..052b276 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -959,6 +959,19 @@ multiple_definition (struct bfd_link_info *info,
     && bfd_is_abs_section (nsec->output_section)))
     return;

+  /* Ignore a redefinition from excluded section.  */
+  if (!bfd_link_relocatable (&link_info)
+      && ((osec->flags & SEC_EXCLUDE) != 0
+    || (nsec->flags & SEC_EXCLUDE) != 0))
+    {
+      if ((osec->flags & SEC_EXCLUDE) != 0)
+  {
+    h->u.def.section = nsec;
+    h->u.def.value = nval;
+  }
+      return;
+    }
+
   name = h->root.string;
   if (nbfd == NULL)
     {

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]