https://sourceware.org/bugzilla/show_bug.cgi?id=24806
Bug ID: 24806 Summary: Linking with unclosed -start-group and -T init.ld creates incorrect result Product: binutils Version: 2.33 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: ohngeonocaewoungooth at xff dot cz Target Milestone: --- Created attachment 11906 --> https://sourceware.org/bugzilla/attachment.cgi?id=11906&action=edit Tar file with files to reproduce the good/bad binaries If I link with '-T init.ld' and a unclosed -start-group: ------------------------------------------ SECTIONS { .tools : { tool_entries = .; *(.tools) LONG(0) LONG(0) } } INSERT AFTER .debug; -------------------------------------------- The tools section will be placed differently than if I don't use -start-group or close it explicitly. objdump -h prints: -------------------------------------- bad: file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn 0 .tools 00000020 0000000000000000 0000000000000000 00001000 2**0 CONTENTS, ALLOC, LOAD, DATA ... [snip] ... -------------------------------------- good: file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn ... [snip] ... 25 .tools 00000020 0000000000006060 0000000000006060 00003060 2**0 CONTENTS, ALLOC, LOAD, DATA -------------------------------------- This leads to a non-working executable. I've attached a complete test case. -- 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