This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR82757
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 30 Oct 2017 13:48:00 +0100 (CET)
- Subject: [PATCH] Fix PR82757
- Authentication-results: sourceware.org; auth=none
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 <rguenther@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;