summaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-02-08 01:32:59 +0000
committerH.J. Lu <hjl.tools@gmail.com>2013-02-08 01:32:59 +0000
commita9fdcae883de81048b970b54371cf286779c2f34 (patch)
tree3d3bf43903a0d1d9ed4c7fa0bbc962a5083591f2 /bfd/elflink.c
parent75e5f2f09cb67c6631ddc34494d8dc4485e141fb (diff)
downloadbinutils-redhat-a9fdcae883de81048b970b54371cf286779c2f34.tar.gz
Set STB_GNU_UNIQUE only if symbol is defined in regular object
bfd/ PR ld/15107 * elflink.c (elf_link_output_extsym): Set STB_GNU_UNIQUE only if symbol is defined in regular object. ld/testsuite/ PR ld/15107 * ld-unique/unique_empty.s: Add reference to "b".
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index d336730e07..e6c835153f 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -8868,7 +8868,8 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
/* Turn off visibility on local symbol. */
sym.st_other &= ~ELF_ST_VISIBILITY (-1);
}
- else if (h->unique_global)
+ /* Set STB_GNU_UNIQUE only if symbol is defined in regular object. */
+ else if (h->unique_global && h->def_regular)
sym.st_info = ELF_ST_INFO (STB_GNU_UNIQUE, h->type);
else if (h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_defweak)