On Mon, Oct 30, 2017 at 01:48:00PM +0100, Richard Biener wrote: > > 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.
Doesn't that make a gnu_lto_* symbol defined in the same shared library or binary hidden, even when not hidden in the source? Or are there . or $ characters in the name that make that impossible? > 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; Jakub