diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-05-06 09:46:34 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-05-06 09:46:50 -0700 |
commit | 97196564c7e981bab7b968e19b171c5dfcb28c3c (patch) | |
tree | 4a4394c52a91f1baf906d5541da3d8653bf82991 /ld/testsuite/ld-elf/pr17550-3.s | |
parent | 030e823caf4243a3337c2134a4a2f38490d3cf3d (diff) | |
download | gdb-97196564c7e981bab7b968e19b171c5dfcb28c3c.zip gdb-97196564c7e981bab7b968e19b171c5dfcb28c3c.tar.gz gdb-97196564c7e981bab7b968e19b171c5dfcb28c3c.tar.bz2 |
Strip global symbol defined in discarded section
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.
Diffstat (limited to 'ld/testsuite/ld-elf/pr17550-3.s')
-rw-r--r-- | ld/testsuite/ld-elf/pr17550-3.s | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr17550-3.s b/ld/testsuite/ld-elf/pr17550-3.s new file mode 100644 index 0000000..3d7c252 --- /dev/null +++ b/ld/testsuite/ld-elf/pr17550-3.s @@ -0,0 +1,14 @@ + .data + .dc.a y + .section .data,"awG",%progbits,foo_group,comdat + .type y, %object + .size y, 4 +y: + .zero 4 + .globl x + .type x, %object + .size x, 4 +x: + .zero 4 + .globl x_alias + .set x_alias,x |