This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Committed: fix ld-elf/pr19617b for cris-linux
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: binutils at sourceware dot org
- Date: Tue, 23 Feb 2016 02:16:05 +0100
- Subject: Committed: fix ld-elf/pr19617b for cris-linux
- Authentication-results: sourceware.org; auth=none
This fixes the
FAIL: ld-elf/pr19617b
I see in my autotester for cris-linux, after I'd restarted it
due to manual intervention required when doing "git pull", some
pruning of certain branches; not completely understood.
In ld.texinfo:
@item --dynamic-list-data
Include all global data symbols to the dynamic list.
So, this implies "regardless of whether they're referenced or
not" like with -E? Then this seems like the right fix.
Otherwise, the pr19617b test needs revising and I don't mean
xfail/notarget entries.
Committed.
bfd:
commit 2d8dcb8135e454c47bc8609e3f9d89b29ef0b8d2
Author: Hans-Peter Nilsson <hp@bitrange.com>
Date: Tue Feb 23 02:06:45 2016 +0100
Fix test-case ld-elf/pr19617b
* elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
discard unused non-function symbols when --dynamic-list-data.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1e0f6a1..611f905 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-23 Hans-Peter Nilsson <hp@axis.com>
+
+ Fix test-case ld-elf/pr19617b
+ * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
+ discard unused non-function symbols when --dynamic-list-data.
+
2016-02-22 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_link_renumber_dynsyms): Always create the
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 7799cf4..64dc3ae 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -4032,8 +4032,10 @@ elf_cris_discard_excess_program_dynamics (struct elf_cris_link_hash_entry *h,
have to export it as a dynamic symbol. This was already done for
functions; doing this for all symbols would presumably not
introduce new problems. Of course we don't do this if we're
- exporting all dynamic symbols. */
- if (! info->export_dynamic
+ exporting all dynamic symbols, or all data symbols, regardless of
+ them being referenced or not. */
+ if (! (info->export_dynamic
+ || (h->root.type != STT_FUNC && info->dynamic_data))
&& h->root.dynindx != -1
&& !h->root.def_dynamic
&& !h->root.ref_dynamic)
brgds, H-P