This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix garbage collection of common symbols
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 20 Jan 2015 11:09:48 +1030
- Subject: Re: Fix garbage collection of common symbols
- Authentication-results: sourceware.org; auth=none
- References: <20150119110310 dot GA12931 at bubble dot grove dot modra dot org>
On Mon, Jan 19, 2015 at 09:33:10PM +1030, Alan Modra wrote:
> * elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
> (bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
I forgot powerpc64 has its own gc_mark_dynamic_ref.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 06cfacb..f819610 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+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 ld/17615
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index f6a8ccb..5a1ee50 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -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
--
Alan Modra
Australia Development Lab, IBM