https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83452
--- Comment #16 from dave.anglin at bell dot net --- On 2019-09-21 5:03 p.m., dimitar.yordanov at sap dot com wrote: > after this fix I see.debug_info entries in the .symtab, which seem unneeded to > me(on Linux x86_64). If they are unnecessary should they be removed by the > linker or the plugin? Is the fix in this patch only needed for HPUX, because > of > misbehaving linker? > > > cat > foo.c << EOF > const char *a = "a"; > EOF > > g++ -flto -gdwarf-4 -g1 -o foo.c.o -c foo.c > g++ -flto -shared -o libfoo.so foo.c.o > objdump -t libfoo.so | grep debug_info I suggest you try mainline. This change and a preceding change revised the lto processing for weak symbols: 2019-08-27 Martin Liska <mli...@suse.cz> PR lto/91478 * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): First find a WEAK HIDDEN symbol in symbol table that will be preserved. Later, use the symbol name for all removed symbols. The special handling for 64bit HPUX has been removed. If problem still exists, then there should be a new bug report.