diff options
author | Alexander Fedotov-B55613 <b55613@freescale.com> | 2017-08-11 16:47:02 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2017-08-14 10:18:14 +0200 |
commit | 1f6644876e66cfd5be2306b7df5215917987d95d (patch) | |
tree | 0cf7ce7764b7d45566f1fd94578d76b8ad27faa3 | |
parent | 9d602b98f838298286e2bf01683bc57ca73d27a3 (diff) | |
download | cygnal-1f6644876e66cfd5be2306b7df5215917987d95d.tar.gz cygnal-1f6644876e66cfd5be2306b7df5215917987d95d.tar.bz2 cygnal-1f6644876e66cfd5be2306b7df5215917987d95d.zip |
use stack from linker script when nosys
-rw-r--r-- | libgloss/aarch64/crt0.S | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libgloss/aarch64/crt0.S b/libgloss/aarch64/crt0.S index 3bf027874..0c669d9ba 100644 --- a/libgloss/aarch64/crt0.S +++ b/libgloss/aarch64/crt0.S @@ -83,7 +83,7 @@ FUNC_START _start /* Start by setting up a stack */ - +#ifdef ARM_RDI_MONITOR /* Issue Angel SVC to read memory info. ptr to ptr to 4 words to receive data. */ @@ -101,6 +101,10 @@ exposed here in the HeapInfo Angel call. */ ldr x0, .LC0 /* point at returned values */ ldr x1, [x0, #8] /* get heap_limit */ +#else + /* Set up the stack pointer to a fixed value. */ + ldr x1, .Lstack +#endif #ifdef __ILP32__ /* Sanity check on the heap base. */ ldr x0, [x0] /* get heap_base */ @@ -149,10 +153,12 @@ bl FUNCTION (initialise_monitor_handles) #endif +#ifdef __USES_INITFINI__ /* .init and .fini sections are used to create constructors and destructors. Here we call the _init function and arrange for _fini to be called at program exit. */ ldr x0, .Lfini +#endif bl FUNCTION (atexit) bl FUNCTION (_init) @@ -237,14 +243,24 @@ FUNCTION (_cpu_init_hook): ret .align 3 +#ifdef ARM_RDP_MONITOR .LC0: GEN_DWORD HeapBase +#else +.Lstack: + GEN_DWORD __stack + + .weak __stack +#endif .LC1: GEN_DWORD __bss_start__ .LC2: GEN_DWORD __bss_end__ +#ifdef __USES_INITFINI__ .Lfini: GEN_DWORD FUNCTION(_fini) +#endif +#ifdef ARM_RDI_MONITOR .Lenvp: GEN_DWORD env .Lcmdline: @@ -268,3 +284,4 @@ CommandLine: .space 256,0 /* Maximum length of 255 chars handled. */ AngelSVCArgs: GEN_DWORD CommandLine .dword 255 +#endif
\ No newline at end of file |