The following fixes the gold linker still recognizing LTO bytecode
via an UNDEF __gnu_lto_* symbol.  So on "removal" of the symbol
make sure to strip two leading _s.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2017-10-30  Richard Biener  <rguent...@suse.de>

        PR lto/82757
        * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
        Strip two leading _s from the __gnu_lto_* symbols.

Index: libiberty/simple-object-elf.c
===================================================================
--- libiberty/simple-object-elf.c       (revision 254211)
+++ libiberty/simple-object-elf.c       (working copy)
@@ -1384,7 +1384,12 @@ simple_object_elf_copy_lto_debug_section
                                  && p[1] == '_'
                                  && strncmp (p + (p[2] == '_'),
                                              "__gnu_lto_", 10) == 0)
-                               other = STV_HIDDEN;
+                               {
+                                 other = STV_HIDDEN;
+                                 ELF_SET_FIELD (type_functions, ei_class, Sym,
+                                                ent, st_name, Elf_Word,
+                                                st_name + 2);
+                               }
                            }
                        }
                      *st_other = other;

Reply via email to