Bloated binaries following the use of AT(...) linker script command

Prasad B bprasad@cs.arizona.edu
Tue Jun 16 22:27:00 GMT 2009


On Tue, Jun 16, 2009 at 2:26 AM, Alan Modra <amodra@bigpond.net.au> wrote:

> On Mon, Jun 15, 2009 at 08:10:51PM -0700, Prasad B wrote:
> > Thanks Alan for the response. I changed the value to a 32-bit one and
> > the problem persists.
> >
> > PHDRS {
> >     text PT_LOAD AT(0x81000000) FLAGS(7);   /* RWX */
> >     note PT_NOTE FLAGS(4);  /* R__ */
> > }
>
> Sorry, I should have looked properly at what you were trying to do
> before my first reply..  AT in PHDRS specifies the load address of
> the segment, but doesn't change the load address of sections
> assigned to that segment.  No doubt your section load addresses are a
> long way from 0x81000000, so the segment contains a lot of zeros.

As the manual says "The AT command for a program header overrides the
section attribute". Since all sections could map into a lone segment,
isn't the above math a source of inflated binaries ?

Is there any alternative way (without causing bloated binaries) of
specifying that all sections be mapped into a lone segment and that
the virtual address of the segment is 0xc0000000 (3GB) and the load
address is 0x81000000 (in MIPS the address translates to physical
address of 0x1000000) ?

thank you,
Prasad.



More information about the Binutils mailing list