This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] cris: Don't hide symbol which was forced to be dynamic
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 14 Oct 2017 18:24:54 -0000
- Subject: [binutils-gdb] cris: Don't hide symbol which was forced to be dynamic
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5d84490bf6ac806c15781a833f0e1e7a191f334f
commit 5d84490bf6ac806c15781a833f0e1e7a191f334f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Oct 14 11:23:45 2017 -0700
cris: Don't hide symbol which was forced to be dynamic
h->root.dynamic is set on symbols which were forced to be dynamic due
to a version script file. Don't remove such symbols from dynamic symbol
table. This fixes:
FAIL: ld-elf/pr21384
PR ld/21384
* elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
hide symbol which was forced to be dynamic.
Diff:
---
bfd/ChangeLog | 6 ++++++
bfd/elf32-cris.c | 1 +
2 files changed, 7 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9a124bd..5f3fb8c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/21384
+ * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
+ hide symbol which was forced to be dynamic.
+
+2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
+
PR ld/22269
* elf32-cris.c (cris_elf_relocate_section): Don't generate
dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 4c80d00..387c7c7 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -3988,6 +3988,7 @@ elf_cris_discard_excess_program_dynamics (struct elf_cris_link_hash_entry *h,
if (! (info->export_dynamic
|| (h->root.type != STT_FUNC && info->dynamic_data))
&& h->root.dynindx != -1
+ && !h->root.dynamic
&& !h->root.def_dynamic
&& !h->root.ref_dynamic)
{