From: Richard Biener Date: Thu, 31 Aug 2017 11:21:40 +0000 (+0000) Subject: re PR lto/81968 (early lto debug objects make Solaris ld SEGV) X-Git-Tag: upstream/12.2.0~37340 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a621861e39a42ee8b770d660b36041f2ac8bc4a4;p=platform%2Fupstream%2Fgcc.git re PR lto/81968 (early lto debug objects make Solaris ld SEGV) 2017-08-31 Richard Biener PR lto/81968 * simple-object-elf.c (simple_object_elf_copy_lto_debug_section): Keep names of removed global symbols. From-SVN: r251560 --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index e8165a0..191a311 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2017-08-31 Richard Biener + + 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 * simple-object-xcoff.c (simple_object_xcoff_find_sections): diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c index ee7a38c..646208a 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,