https://sourceware.org/bugzilla/show_bug.cgi?id=20302
Bug ID: 20302
Summary: Linker considers first specification of
-Tdata/text/bss, not the last, if they are specified
multiple times on the command line
Product: binutils
Version: 2.27 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: saaadhu at sourceware dot org
Target Milestone: ---
If any of the -T{data,text,bss} happen to be specified multiple times on the
command line, the start address of the corresponding section is set to the
value specified in the first instance of the option, not the last.
For example,
$ cat test.c
int main(void) {return 0;}
$ avr-gcc -mmcu=atmega128 -c test.c
$ avr-ld -mavr51 -nostartfiles -Tdata=0x800102 -Tdata=0x800204 test.o
$ avr-objdump -h a.out
a.out: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00800102 00000012 00000086 2**0
CONTENTS, ALLOC, LOAD, DATA
...
In contrast, --section-start,.data=<address> works as expected, the value
specified last is what gets set as the section's VMA.
In general, if the same option is specified multiple times with varying
arguments, the last argument wins, so IMO -T needs to follow that convention.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils