This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: start address of a binary


> Date: Wed, 07 Mar 2001 11:18:00 -0500
> From: Sébastien Côté <scote1@Matrox.COM>

> Hi !
> 
> I'd like to know why the text start address of an elf binary is so
> different for each architecture.  For example, it's 0x10000000 for
> linux, 0x01800000 for elf32ppc and 0x40000 for elf32lppc.
> 
> Does this really changes anything (as long as the address is in
> user-space)?  I'm trying to run Linux on PowerPC in little-endian,
> should I use 0x10000000 or something else?  I experimented a bit and it
> SEEMS to work with any address, but then why all those diffrent
> addresses?...

It used to be 0x40000 for everything, which was chosen as the lowest
address that allows a few unmapped pages after location 0 (so that
derefences off NULL pointers will segfault).

It was changed to 0x01800000 when shared libraries were implemented,
so that shared libraries could be placed in the first 2^26 bytes of
memory so that the dynamic linker could create branches to them in the
PLT using a 'ba' instruction.

It was then changed to 0x10000000 at the request of the people trying
to run Linux executables under AIX, I think because AIX reserves the
entire low segment of memory.  The powerpc MMU has a 52-bit virtual
memory space, of which at any time a process can see 16 segments of
size 2^28 bytes each; AIX tries to take advantage of this by arranging
the processes' memory map so that some segments are shared, which means
it doesn't have to change all 16 segment registers while context
switching, gives it better caching performance, and causes all sorts
of problems.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]