[Patch, AArch64] Update crt0.S to be ILP32-friendly
Yufeng Zhang
Yufeng.Zhang@arm.com
Mon Jun 24 10:35:00 GMT 2013
Hi,
This patch makes a number of changes to the crt0.S file in order to
support the ILP32 ABI.
Because the Angel APIs are kept the same between LP64 and ILP32, some
changes are needed to make sure the heap info can be obtained properly
from the HeapInfo Angel call.
The patch also fixes the argv handling where the pointers pushed to the
stack shall be 4-byte size when __ILP32__ is defined.
The gcc patches for ILP32 (including the one that defines __ILP32__)
will be sent shortly, but this patch can be committed independently.
OK for the trunk?
Thanks,
Yufeng
libgloss/
* aarch64/crt0.S (GEN_DWORD): New macro definition.
(PTR_REG): Ditto.
(PTR_SIZE): Ditto.
(PTR_LOG_SIZE): Ditto.
(start): Use GEN_DWORD to replace the .dword of HeapBase,
__bss_start__, __bss_end__, FUNCTION(_fini), env and
CommandLine; when __ILP32__ is defined, set the stack base to
the top end of the 32-bit address space if the returned value
from the Angel API call is larger than or equal to 4 GiB.
Also carry out sanity check on the heap base; abort if the
base is larger than or equal to 4 GiB. Use other new
macros in the instructions that processes the argv arrays.
(StackBase): New lable; replace __stack_base__.
(__stack_base__): Set with StackBase or StackBase + 4.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 06-crt0.patch
Type: text/x-patch
Size: 4336 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20130624/dfa13491/attachment.bin>
More information about the Newlib
mailing list