Summary: | "ld -r" is broken | ||
---|---|---|---|
Product: | binutils | Reporter: | H.J. Lu <hjl.tools> |
Component: | ld | Assignee: | unassigned |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | amodra, bug-binutils |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ia64-linux | |
Build: | Last reconfirmed: | ||
Attachments: | A testcase |
Description
H.J. Lu
2005-12-18 15:20:58 UTC
Created attachment 807 [details] A testcase I believe it is caused by http://sourceware.org/ml/binutils/2005-11/msg00350.html I am enclosing a tar file. There are good.o and bad.o, which are generated by # ld -o [good.o|bad.o] -r namei.o vfatfs_syms.o bad.o is generated by the new linker. I have verified that http://sourceware.org/ml/binutils/2005-11/msg00239.html is the real cause. It changes the output of "ld -r" from Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .text PROGBITS 0000000000000000 00000040 0000000000005130 0000000000000000 AX 0 0 32 [ 2] .rela.text RELA 0000000000000000 00005f60 00000000000011e8 0000000000000018 14 1 8 [ 3] .modinfo PROGBITS 0000000000000000 00005170 0000000000000032 0000000000000000 A 0 0 8 [ 4] .rodata.str1.8 PROGBITS 0000000000000000 000051a8 000000000000024c 0000000000000001 AMS 0 0 8 ... to Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .modinfo PROGBITS 0000000000000000 00000040 0000000000000032 0000000000000000 A 0 0 8 [ 2] .rodata.str1.8 PROGBITS 0000000000000000 00000078 000000000000024c 0000000000000001 AMS 0 0 8 [ 3] .text PROGBITS 0000000000000000 000002e0 0000000000005130 0000000000000000 AX 0 0 32 [ 4] .rela.text RELA 0000000000000000 00005f78 00000000000011e8 0000000000000018 14 3 8 That is incorrect. The "prev" field set by + ret->os.prev = &((*lang_output_section_statement.tail) + ->output_section_statement); is always NULL since tail points the next field of the last element on the list. A patch is posted at http://sourceware.org/ml/binutils/2005-12/msg00153.html It is fixed by http://sourceware.org/ml/binutils/2005-12/msg00225.html |