https://sourceware.org/bugzilla/show_bug.cgi?id=20528
Bug ID: 20528 Summary: ld -r doesn't handle SHF_EXCLUDE section properly Product: binutils Version: 2.28 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: hjl.tools at gmail dot com Target Milestone: --- [hjl@gnu-6 exclude-1]$ cat x.s .text .section .text.startup,"ax",%progbits .globl main .type main, %function main: .byte 0 [hjl@gnu-6 exclude-1]$ cat y.s .text .section .text.startup,"axe",%progbits .globl main1 .type main1, %function main1: .byte 0 [hjl@gnu-6 exclude-1]$ make LD=ld y gcc -c -o y.o y.s gcc -c -o x.o x.s ld -r -o y y.o x.o [hjl@gnu-6 exclude-1]$ readelf -SW y There are 8 section headers, starting at offset 0x138: Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [ 0] NULL 0000000000000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 0000000000000000 000040 000000 00 AX 0 0 1 [ 2] .text.startup PROGBITS 0000000000000000 000040 000002 00 AXE 0 0 1 [ 3] .data PROGBITS 0000000000000000 000042 000000 00 WA 0 0 1 [ 4] .bss NOBITS 0000000000000000 000042 000000 00 WA 0 0 1 [ 5] .shstrtab STRTAB 0000000000000000 0000fc 00003a 00 0 0 1 [ 6] .symtab SYMTAB 0000000000000000 000048 0000a8 18 7 5 8 [ 7] .strtab STRTAB 0000000000000000 0000f0 00000c 00 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), l (large), p (processor specific) [hjl@gnu-6 exclude-1]$ 2 different .text.startup sections are merged into one. -- 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