]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix garbage collection of common symbols for powerpc64
authorAlan Modra <amodra@gmail.com>
Tue, 20 Jan 2015 00:36:28 +0000 (11:06 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 11 Feb 2015 12:36:42 +0000 (23:06 +1030)
I forgot powerpc64 has its own gc_mark_dynamic_ref.

PR ld/17615
* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
ELF_COMMON_DEF syms.

bfd/ChangeLog
bfd/elf64-ppc.c

index 0300b59f7c77f83387f4d316a227931a02a74c21..cba389e715f2288952ec6bcc13e83550a0bad3d5 100644 (file)
@@ -1,6 +1,11 @@
 2015-02-11  Alan Modra  <amodra@gmail.com>
 
        Apply from master.
+       2015-01-20  Alan Modra  <amodra@gmail.com>
+       PR ld/17615
+       * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
+       ELF_COMMON_DEF syms.
+
        2015-01-19  Alan Modra  <amodra@gmail.com>
        PR 17165
        * elf-bfd.h (ELF_COMMON_DEF_P): Note that this might be true for
index 88ae80c77cc3bd1515bb6ff830ec49cb633124ae..318f41a0ac2d9c7bc149e73763e2eea8751ec3cf 100644 (file)
@@ -6232,7 +6232,7 @@ ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf)
   if ((eh->elf.root.type == bfd_link_hash_defined
        || eh->elf.root.type == bfd_link_hash_defweak)
       && (eh->elf.ref_dynamic
-         || (eh->elf.def_regular
+         || ((eh->elf.def_regular || ELF_COMMON_DEF_P (&eh->elf))
              && ELF_ST_VISIBILITY (eh->elf.other) != STV_INTERNAL
              && ELF_ST_VISIBILITY (eh->elf.other) != STV_HIDDEN
              && (!info->executable