ld ia32, nonconstant expression for load base when using "ADDR(.bss) + SIZEOF(.bss)"

H. J. Lu hjl@lucon.org
Wed May 16 16:26:00 GMT 2007


On Wed, May 16, 2007 at 06:16:12PM +0200, Etienne Lorrain wrote:
> --- "H. J. Lu" <hjl@lucon.org> wrote:
> > On Wed, May 16, 2007 at 05:13:47PM +0200, Etienne Lorrain wrote:
> > >  I can no more define, in the Linux linker file, the section:
> > >   .realmode 0 : AT (ADDR(.bss) + SIZEOF(.bss) - 0xC0000000) {
> > >       ....
> > >       }
> > 
> > Is this the same as
> > 
> > http://sources.redhat.com/bugzilla/show_bug.cgi?id=4090
> 
>  Do not know, how to check?
>  I know that:
> .realmode 0 : AT (0x100000 - 0xC0000000) {
>     ....
>     }
>  works (but at the wrong address).
> 
>  Will check tomorow if I know what to do.

You can't use ADDR on section after, like:

SECTIONS
{
  .bar 0 : AT ((ADDR(.foo) + 4095) & ~(4095)) { *(.bar) }
  .foo : { *(.foo) }
}

I think

SECTIONS
{
  .foo : { *(.foo) }
  .bar 0 : AT ((ADDR(.foo) + 4095) & ~(4095)) { *(.bar) }
}

will work.


H.J.



More information about the Binutils mailing list