I am testing the following to silence more of Solaris ld warnings about
early debug objects.

LTO bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2017-08-31  Richard Biener  <rguent...@suse.de>

        PR lto/81968
        * simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
        Keep names of removed global symbols.

Index: libiberty/simple-object-elf.c
===================================================================
--- libiberty/simple-object-elf.c       (revision 251553)
+++ libiberty/simple-object-elf.c       (working copy)
@@ -1349,9 +1349,11 @@ simple_object_elf_copy_lto_debug_section
 
                  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,

Reply via email to