diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-05-05 05:35:01 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-05-05 05:56:41 -0700 |
commit | ea0e05d28045e02c578589217a870d82a1a6b09f (patch) | |
tree | 856f7503ce218befebf3bffe861204e6199c35da /ld/testsuite/ld-elf/pr17550-4.s | |
parent | c175a65796a6f1d6a69ed0d7e3bce6f048c8e983 (diff) | |
download | binutils-gdb-ea0e05d28045e02c578589217a870d82a1a6b09f.tar.gz |
Strip global symbol defined in discarded sectionusers/hjl/pr17550
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-4.s')
-rw-r--r-- | ld/testsuite/ld-elf/pr17550-4.s | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr17550-4.s b/ld/testsuite/ld-elf/pr17550-4.s new file mode 100644 index 00000000000..d0442fd4f05 --- /dev/null +++ b/ld/testsuite/ld-elf/pr17550-4.s @@ -0,0 +1,15 @@ + .data + .dc.a y + .section .data,"awG",%progbits,foo_group,comdat + .globl y + .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 |