1 // Mark stack as non-executable
2 #if defined(__linux__) && defined(__ELF__)
3 .section .note.GNU-stack, "", %progbits
6 /* See i386/morestack.S for the lengthy, general explanation. */
11 #if defined(__APPLE__)
17 #if defined(__APPLE__)
18 #define MORESTACK ___morestack
19 #define STACK_EXHAUSTED _rust_stack_exhausted
21 #define MORESTACK __morestack
22 #define STACK_EXHAUSTED rust_stack_exhausted
25 .global STACK_EXHAUSTED
28 // Unfortunately LLVM yet doesn't support emitting correct debug
29 // DWARF information for non-ELF targets so to make it compile
30 // on iOS all that directives are simply commented out
31 #if defined(__APPLE__)
37 #if defined(__APPLE__)
38 .private_extern MORESTACK
43 #if !defined(__APPLE__)
44 .type MORESTACK,%function
47 // r4 and r5 are scratch registers for __morestack due to llvm
48 // ARMFrameLowering::adjustForSegmentedStacks() implementation.
52 // Save frame pointer and return address
55 UNWIND .save {r6, fp, lr}
60 UNWIND .setfp fp, sp, #4
63 // Save argument registers of the original function
64 push {r0, r1, r2, r3, lr}
67 bl STACK_EXHAUSTED@plt
69 // the above function ensures that it never returns