Files
ipxe/src/arch/arm32/core/setjmp.S
Michael Brown fcfb70bfb2 [arm] Inhibit linker warnings about an implied executable stack
Some versions of the 32-bit ARM linker seem to treat the absence of a
.note.GNU-stack section as implying an executable stack, and will
print a warning that this is deprecated behaviour.

Silence the warning by adding a .note.GNU-stack section to each
assembly file and retaining the sections in the Linux linker script.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2023-01-23 12:55:44 +00:00

34 lines
668 B
ArmAsm

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
.section ".note.GNU-stack", "", %progbits
.text
.arm
/*
* Save stack context for non-local goto
*/
.globl setjmp
.type setjmp, %function
setjmp:
/* Store registers */
stmia r0, { r4, r5, r6, r7, r8, r9, r10, fp, sp, lr }
/* Return 0 when returning as setjmp() */
mov r0, #0
bx lr
.size setjmp, . - setjmp
/*
* Non-local jump to a saved stack context
*/
.globl longjmp
.type longjmp, %function
longjmp:
/* Restore registers */
ldmia r0, { r4, r5, r6, r7, r8, r9, r10, fp, sp, lr }
/* Force result to non-zero */
movs r0, r1
moveq r0, #1
/* Return to setjmp() caller */
bx lr
.size longjmp, . - longjmp