re PR lto/81968 (early lto debug objects make Solaris ld SEGV)
authorRichard Biener <rguenther@suse.de>
Thu, 31 Aug 2017 11:21:40 +0000 (11:21 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 31 Aug 2017 11:21:40 +0000 (11:21 +0000)
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

libiberty/ChangeLog
libiberty/simple-object-elf.c

index e8165a0911a9b68dc20e66b5092bf82fe66210e6..191a3116bb72d96ff79d8dd3e3bfd76a8e2c9018 100644 (file)
@@ -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):
index ee7a38cf80eafd699455f43134a7d0df6ac6530c..646208a85b9a888d433d87758c4a77a33cca37c7 100644 (file)
@@ -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,