aboutsummaryrefslogtreecommitdiff
path: root/libiberty/simple-object-elf.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-31 11:21:40 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-31 11:21:40 +0000
commitcb194cb7e741bba8741c61cdd63cc4cbe3b0c3f2 (patch)
treecb445bcf3bfb129dbb4847e7e752fa28f9b4d124 /libiberty/simple-object-elf.c
parentbc3e9c9df58c165b0157aabf69b222130c835a63 (diff)
2017-08-31 Richard Biener <rguenther@suse.de>
PR lto/81968 * simple-object-elf.c (simple_object_elf_copy_lto_debug_section): Keep names of removed global symbols. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251560 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/simple-object-elf.c')
-rw-r--r--libiberty/simple-object-elf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c
index ee7a38cf80e..646208a85b9 100644
--- a/libiberty/simple-object-elf.c
+++ b/libiberty/simple-object-elf.c
@@ -1349,9 +1349,11 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
if (discard)
{
- /* Make discarded symbols undefined and unnamed. */
- ELF_SET_FIELD (type_functions, ei_class, Sym,
- ent, st_name, Elf_Word, 0);
+ /* Make discarded symbols undefined and unnamed
+ in case it is local. */
+ if (ELF_ST_BIND (*st_info) == STB_LOCAL)
+ ELF_SET_FIELD (type_functions, ei_class, Sym,
+ ent, st_name, Elf_Word, 0);
ELF_SET_FIELD (type_functions, ei_class, Sym,
ent, st_value, Elf_Addr, 0);
ELF_SET_FIELD (type_functions, ei_class, Sym,