This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Resetting LMA for new VMAs
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: binutils <binutils at sources dot redhat dot com>
- Date: Fri, 4 Apr 2008 06:09:49 -0700
- Subject: Re: Resetting LMA for new VMAs
- References: <47F6113D.8030201@codesourcery.com>
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.