summaryrefslogtreecommitdiff
path: root/bfd/elf32-cris.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@bitrange.com>2016-02-23 02:06:45 +0100
committerHans-Peter Nilsson <hp@bitrange.com>2016-02-23 02:06:45 +0100
commit2d8dcb8135e454c47bc8609e3f9d89b29ef0b8d2 (patch)
treec83a513a34b6c2b6f3bf4c2cf7da54a513922ca3 /bfd/elf32-cris.c
parent1a6e6083b69dcb695e175b5dc02342391da6ba22 (diff)
downloadbinutils-gdb-2d8dcb8135e454c47bc8609e3f9d89b29ef0b8d2.tar.gz
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.
Diffstat (limited to 'bfd/elf32-cris.c')
-rw-r--r--bfd/elf32-cris.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 7799cf4f041..64dc3ae5844 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)