Resetting LMA for new VMAs

H.J. Lu hjl.tools@gmail.com
Fri Apr 4 13:10:00 GMT 2008


On Fri, Apr 04, 2008 at 12:30:05PM +0100, Nathan Sidwell wrote:
> This patch addresses a problem I found with the attached linker script.  
> The current behaviour places '.reset's LMA so as to maintain the same delta 
> from the previous section as the VMA delta:
>
>   0 .text         00000004  00001000  00001000  00001000  2**2
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>   1 .data         00000004  00000010  00001004  00001010  2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>   2 .reset        00000004  0000fffc  00010ff0  00001ffc  2**0
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>
>
> but that's a surprise (especially if .reset is really at the top of the 
> address space, in which case its LMA is set somewhere in the middle of the 
> address space).  With this patch we get:
>
>   0 .text         00000004  00001000  00001000  00001000  2**2
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>   1 .data         00000004  00000010  00001004  00001010  2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>   2 .reset        00000004  0000fffc  0000fffc  00001ffc  2**0
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>
> I'm not sure if this will have a deleterious effect on linker scripts that 
> I'm unaware of though.  Perhaps some scripts that have displaced LMAs 
> explicitly set the VMA to be just after the previous section, and expect 
> the current behaviour.
> Testing on i686-linux shows no problems.
>

Did you test both i686-linux and x86-64-linux 2.6 kernel build? Last
time when we changed it, it broke Linux kernel build.


H.J.



More information about the Binutils mailing list