mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
97196564c7
When a global symbol is defined in COMDAT group, we shouldn't leave an undefined symbol in symbol table when the symbol section is discarded unless there is a reference to the symbol outside of COMDAT group. bfd/ PR ld/17550 * elf-bfd.h (elf_link_hash_entry): Update comments for indx, documenting that indx == -3 if symbol is defined in a discarded section. * elflink.c (elf_link_add_object_symbols): Set indx to -3 if symbol is defined in a discarded section. (elf_link_output_extsym): Strip a global symbol defined in a discarded section. ld/ PR ld/17550 * testsuite/ld-elf/pr17550-1.s: New file. * testsuite/ld-elf/pr17550-2.s: Likewise. * testsuite/ld-elf/pr17550-3.s: Likewise. * testsuite/ld-elf/pr17550-4.s: Likewise. * testsuite/ld-elf/pr17550a.d: Likewise. * testsuite/ld-elf/pr17550b.d: Likewise. * testsuite/ld-elf/pr17550c.d: Likewise. * testsuite/ld-elf/pr17550d.d: Likewise.
15 lines
477 B
Makefile
15 lines
477 B
Makefile
#source: pr17550-2.s
|
|
#source: pr17550-1.s
|
|
#ld: -r
|
|
#readelf: -s --wide
|
|
#notarget: alpha-*-* cr16-*-* crx-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
|
|
# Disabled on alpha because alpha has a different .set directive.
|
|
# cr16 and crx use non-standard scripts with memory regions, which don't
|
|
# play well with comdat group sections under ld -r. Generic linker
|
|
# targets don't support comdat group sections.
|
|
|
|
#failif
|
|
#...
|
|
+[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +UND x_alias
|
|
#...
|