https://sourceware.org/bugzilla/show_bug.cgi?id=18837
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> --- (In reply to Cary Coutant from comment #2) > Let's use PR 18836 for a broader discussion on the topic of LTO and early > debug. > > With the given script, Gnu ld will link t.o as if it had been named on the > command line. Gold will not; we treat the filenames (with or without > wildcards) as filters, and gold will not link a file unless it's given on > the command line or in an INPUT command in a linker script. > > In addition, gold does not support partial linker scripts. If you have a > linker script with a SECTIONS clause, you'll need to provide a complete > description of the output section, or the final output will almost certainly > not be usable. I see. So I'm trying (same input): SECTIONS { .debug_info 0 : { *(.gnu.lto_.debug_info*) } .debug_abbrev 0 : { *(.gnu.lto_.debug_abbrev*) } .debug_str 0 : { *(.gnu.lto_.debug_str*) } /DISCARD/ : { *(*) } } > ld.gold -o x -T script t.o -r Segmentation fault > ld.gold -o x -T script t.o t.o: plugin needed to handle lto object ld.gold: internal error in address, at ../../gold/output.h:72 (ok, only the -r link is relevant in the end) GNU ld: > ld -o x -T script t.o -r ld: t.o: plugin needed to handle lto object > readelf -S x There are 8 section headers, starting at offset 0x1a0: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .debug_info PROGBITS 0000000000000000 00000040 000000000000000a 0000000000000000 E 0 0 1 [ 2] .rela.debug_info RELA 0000000000000000 00000188 0000000000000018 0000000000000018 I 6 1 8 [ 3] .debug_abbrev PROGBITS 0000000000000000 0000004a 0000000000000001 0000000000000000 E 0 0 1 [ 4] .debug_str PROGBITS 0000000000000000 0000004b 000000000000001e 0000000000000001 MS 0 0 1 [ 5] .shstrtab STRTAB 0000000000000000 00000069 0000000000000045 0000000000000000 0 0 1 [ 6] .symtab SYMTAB 0000000000000000 000000b0 00000000000000a8 0000000000000018 7 4 8 [ 7] .strtab STRTAB 0000000000000000 00000158 000000000000002a 0000000000000000 0 0 1 maybe you can help me writing a linker script that works with GOLD and a partial link (and also suggest how to drop the 'E'xclude bit during that link)? golds "error" messages are not exactly helpful :/ Btw, this is gold from the 2.25 branch head. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils