PowerPC EABI segment alignment
Michael Eager
eager@eagercon.com
Tue Mar 4 02:57:00 GMT 2008
Daniel Jacobowitz wrote:
> On Thu, Feb 28, 2008 at 10:20:47AM -0800, Michael Eager wrote:
>> The PPC SVR4 ABI specifies that segments are aligned on 64K
>> (0x10000) boundaries. [PPC SVR4 ABI, pg. 5-1].
>>
>> The PPC EABI says that there are no program loading requirements.
>> [PPC EABI, pg. 19]
>>
>> Binutils follows the SVR4 specification, even when built with
>> --target=powerpc-eabi and sets segment alignment as 0x10000.
>> (Except for QNX, where the alignment is 0x1000). This causes problems
>> with non-hosted PPC boards with limited memory: the desired alignment
>> is 8 bytes, to avoid memory holes.
>>
>> I patch binutils to set ELF_MAXPAGESIZE=8 to make this happen.
>> How to other folks address this problem?
>
> Maybe you want -N, for building non-paged binaries. The powerpc-eabi
> toolchain can be used with a variety of environments, and some of them
> do have memory protection and dynamic paging; for those, you'll need
> a page size that the hardware supports.
-N makes read-only sections writable which leads them to
being merged with writable sections. That's undesirable
when you want to put R/O data in ROM and R/W in RAM.
Text segment is still aligned on a 64K boundary, IIRC.
Powerpc-eabi may be used in different environments, but I
don't see how it works correctly in the EABI environment.
>> Binutils with --target=powerpc-eabi is built the same as
>> --target=powerpc-svr4. Shouldn't these be different configurations?
>
> No one uses the powerpc-svr4 target that I'm aware of.
There are several targets which are built the same: powerpc-elf,
powerpc-eabi, powerpc-sysv, powerpc-netbsd, powerpc-openbsd, powerpc-kaos.
I can guess that there are similarities between SysV, NetBSD, OpenBSD,
(don't know kaos) but EABI is different, at least in terms of segment
alignment.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
More information about the Binutils
mailing list