adjust stack before appInit
This commit is contained in:
parent
341f10b057
commit
1f52ac344d
@ -15,8 +15,6 @@ void __attribute__((weak)) __attribute__((noreturn)) __libctru_exit(int rc)
|
|||||||
{
|
{
|
||||||
u32 tmp=0;
|
u32 tmp=0;
|
||||||
|
|
||||||
__appExit();
|
|
||||||
|
|
||||||
// Unmap the linear heap
|
// Unmap the linear heap
|
||||||
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size, MEMOP_FREE, 0x0);
|
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size, MEMOP_FREE, 0x0);
|
||||||
|
|
||||||
|
@ -32,6 +32,4 @@ void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
|
|||||||
// Build argc/argv if present
|
// Build argc/argv if present
|
||||||
__system_initArgv();
|
__system_initArgv();
|
||||||
|
|
||||||
__appInit();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@ initSystem:
|
|||||||
bics sp, sp, #7
|
bics sp, sp, #7
|
||||||
str sp, [r2]
|
str sp, [r2]
|
||||||
|
|
||||||
|
|
||||||
|
bl __appInit
|
||||||
bl __libc_init_array
|
bl __libc_init_array
|
||||||
|
|
||||||
ldr r2, =saved_stack
|
ldr r2, =saved_stack
|
||||||
@ -34,6 +36,7 @@ initSystem:
|
|||||||
|
|
||||||
__ctru_exit:
|
__ctru_exit:
|
||||||
bl __libc_fini_array
|
bl __libc_fini_array
|
||||||
|
bl __appExit
|
||||||
|
|
||||||
ldr r2, =saved_stack
|
ldr r2, =saved_stack
|
||||||
ldr sp, [r2]
|
ldr sp, [r2]
|
||||||
|
Loading…
Reference in New Issue
Block a user