This is the mail archive of the
mailing list for the binutils project.
Re: [Patch, avr] Set data section's LMA to AT> text instead of end of .text
- From: nick clifton <nickc at redhat dot com>
- To: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- Cc: binutils at sourceware dot org, chertykov at gmail dot com
- Date: Wed, 20 Nov 2013 16:11:49 +0000
- Subject: Re: [Patch, avr] Set data section's LMA to AT> text instead of end of .text
- Authentication-results: sourceware.org; auth=none
- References: <20131118124055 dot GC4043 at atmel dot com> <528A35DA dot 1070901 at redhat dot com> <20131119061952 dot GA2108 at atmel dot com> <528B9E84 dot 5050100 at redhat dot com> <20131120074655 dot GA636 at atmel dot com>
Thanks - I now understand the problem now. You were right with your
original email, I just did not quite get that the .data section was
using an explicit LMA assigment which was not taking into account the
fact that *other* sections might be assigned to the TEXT memory region
*after* the .text section. So the SIZEOF operator does work - it is
just that it only returns the size of the .text section, not the size of
the .text section and any other sections that follow it in the same region.
So, upon reflection I now agree with your original patch. Please go
ahead and commit it. I will update the MSP430 linker script with a
PS. FYI you can avoid using extra linker scripts in the way that you
showed in your test case. If you change the section attribute in test.c
int x __attribute__((section(".boot,\"ax\",@progbits ;")));
then you do not need a "boot" linker script at all.