arm: Provide alloca()
This provides a simple implementation of alloca for ARM (and enables the associated testcase). As tcc for ARM doesn't contain an assembler, we'll have to resort using gcc for compiling it.
This commit is contained in:
11
lib/alloca-arm.S
Normal file
11
lib/alloca-arm.S
Normal file
@ -0,0 +1,11 @@
|
||||
.text
|
||||
.align 2
|
||||
.global alloca
|
||||
.type alloca, %function
|
||||
alloca:
|
||||
rsb sp, r0, sp
|
||||
bic sp, sp, #7
|
||||
mov r0, sp
|
||||
mov pc, lr
|
||||
.size alloca, .-alloca
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
Reference in New Issue
Block a user