diff options
author | Richard Biener <rguenther@suse.de> | 2017-08-31 11:21:40 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-08-31 11:21:40 +0000 |
commit | a621861e39a42ee8b770d660b36041f2ac8bc4a4 (patch) | |
tree | cb445bcf3bfb129dbb4847e7e752fa28f9b4d124 /libiberty | |
parent | 7488b5779f3d2c350ce7b2bfe8e8cce145efe417 (diff) | |
download | gcc-a621861e39a42ee8b770d660b36041f2ac8bc4a4.tar.gz |
re PR lto/81968 (early lto debug objects make Solaris ld SEGV)
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.
From-SVN: r251560
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 6 | ||||
-rw-r--r-- | libiberty/simple-object-elf.c | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index e8165a0911a..191a3116bb7 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +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. + 2017-08-29 Tony Reix <tony.reix@atos.net> * simple-object-xcoff.c (simple_object_xcoff_find_sections): 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, |