[Patch, avr] Set data section's LMA to AT> text instead of end of .text
Senthil Kumar Selvaraj
senthil_kumar.selvaraj@atmel.com
Wed Nov 20 09:20:00 GMT 2013
More information about the Binutils mailing list
Wed Nov 20 09:20:00 GMT 2013
- Previous message (by thread): [Patch, avr] Set data section's LMA to AT> text instead of end of .text
- Next message (by thread): [Patch, avr] Set data section's LMA to AT> text instead of end of .text
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Nov 19, 2013 at 05:23:16PM +0000, nick clifton wrote:
> Hi Senthil,
>
> >It does work if the input section is assigned to the .text output
> >section - it doesn't if gets assigned to the text MEMORY region.
>
> Umm - can you provide a small example for us to examine please ?
>
Sure.
➜ cat test.c
int y = 2;
int x __attribute__((section(".boot")));
int main()
{
return x;
}
➜ cat boot
SECTIONS
{
.boot :
{
*(.boot)
} > text
}
➜ ~/avr/install/bin/avr-gcc -mmcu=atmega1280 test.c boot
/home/saaadhu/avr/install/lib/gcc/avr/4.8.1/../../../../avr/bin/ld: warning: boot contains output sections; did you forget -T?
/home/saaadhu/avr/install/lib/gcc/avr/4.8.1/../../../../avr/bin/ld: section .boot loaded at [0000000000000130,0000000000000131] overlaps section .data loaded at [0000000000000130,0000000000000131]
collect2: error: ld returned 1 exit status
It works ok if the section is not assigned to the text MEMORY
region i.e. without > text. And it obviously works if the .text
output section contains *(.boot). I'm presuming this is because the .data
section's LMA is explicitly set to start where .text ends, and both .data
and .boot compete for that slot. Did I get that wrong?
Regards
Senthil
- Previous message (by thread): [Patch, avr] Set data section's LMA to AT> text instead of end of .text
- Next message (by thread): [Patch, avr] Set data section's LMA to AT> text instead of end of .text
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list