bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/25458] --gc-sections removes _environ symbol since version 2.21


From: hjl.tools at gmail dot com
Subject: [Bug ld/25458] --gc-sections removes _environ symbol since version 2.21
Date: Fri, 24 Jan 2020 21:18:39 +0000

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
Does this work?

diff --git a/bfd/elflink.c b/bfd/elflink.c
index 300be3f743..be9518fc4a 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -13148,7 +13148,15 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info,
asection *sec,
    dynamic reloc info on the non-weak definition for code
    handling copy relocs.  */
       if (h->is_weakalias)
-  weakdef (h)->mark = 1;
+  {
+    struct elf_link_hash_entry *hw = h->u.alias;
+    hw->mark = 1;
+    while (hw->is_weakalias)
+      {
+        hw = hw->u.alias;
+        hw->mark = 1;
+      }
+  }

       if (start_stop != 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]