From a9fdcae883de81048b970b54371cf286779c2f34 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 8 Feb 2013 01:32:59 +0000 Subject: 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". --- bfd/elflink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bfd/elflink.c') 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) -- cgit v1.2.1