This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix garbage collection of common symbols for powerpc64
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 20 Jan 2015 00:43:20 -0000
- Subject: [binutils-gdb] Fix garbage collection of common symbols for powerpc64
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1c9177d9a5c3e06d3344347c8068acfb7d8ecc8b
commit 1c9177d9a5c3e06d3344347c8068acfb7d8ecc8b
Author: Alan Modra <amodra@gmail.com>
Date: Tue Jan 20 11:06:28 2015 +1030
Fix garbage collection of common symbols for powerpc64
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.
Diff:
---
bfd/ChangeLog | 6 ++++++
bfd/elf64-ppc.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
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