aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-02-06 09:44:25 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-02-10 08:05:54 -0800
commitd6f6f455778b10037503bcc39352b5174bba5e45 (patch)
treebb55f13f52e8450b540735993d05ce7d367cbf29 /bfd
parent8577303939d47fc3dd433ed31f78ee47c6ad0aa8 (diff)
downloadgdb-d6f6f455778b10037503bcc39352b5174bba5e45.zip
gdb-d6f6f455778b10037503bcc39352b5174bba5e45.tar.gz
gdb-d6f6f455778b10037503bcc39352b5174bba5e45.tar.bz2
Mark symbol in executables if it matches dynamic_list
bfd/ PR gold/16530 * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark symbol in executables if it matches dynamic_list. ld/testsuite/ PR gold/16530 * ld-elf/dynamic-1.c: New file. * ld-elf/dynamic-1.rd: Likewise. * ld-elf/dynamic-1.syms: Likewise. * ld-elf/shared.exp (build_tests): Add dynamic-1.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 16ca958..2117f41 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2014-02-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/16530
+ * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark symbol in
+ executables if it matches dynamic_list.
+
2014-02-10 Alan Modra <amodra@gmail.com>
* po/SRC-POTFILES.in: Regenerate.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index af4f6bb..b196203 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12140,11 +12140,15 @@ bfd_boolean
bfd_elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ struct bfd_elf_dynamic_list *d = info->dynamic_list;
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& (h->ref_dynamic
- || ((!info->executable || info->export_dynamic)
+ || ((!info->executable
+ || info->export_dynamic
+ || (d != NULL
+ && (*d->match) (&d->head, NULL, h->root.root.string)))
&& h->def_regular
&& ELF_ST_VISIBILITY (h->other) != STV_INTERNAL
&& ELF_ST_VISIBILITY (h->other) != STV_HIDDEN