mirror of
https://github.com/frida/tinycc
synced 2024-12-22 13:12:34 +03:00
4b3c6e74ab
tccgen.c: doubles need to be aligned, on ARM. The section_reserve() in init_putv does not do that. -D ONE_SOURCE: is now the default and not longer needed. Also, tcc.h now sets the default native target. These both make compiling tcc simple as "gcc tcc.c -o tcc -ldl" again. arm-asm.c: enable pseudo asm also for inline asm tests/tests2/Makefile: disable bitfield tests except on windows and x86_64 and don't generate-always tcc.c: fix a loop with -dt on errors configure: print compiler version (as recognized) tccpp.c: actually define symbols for tcc -dt clear static variables (needed for -dt or libtcc usage) 96_nodata_wanted.c: use __label__ instead of asm lib/files: use native symbols (__i386__ etc.) instead of TCC_TARGET_...
57 lines
975 B
ArmAsm
57 lines
975 B
ArmAsm
/* ---------------------------------------------- */
|
|
/* alloca86_64.S */
|
|
|
|
.globl __bound_alloca
|
|
__bound_alloca:
|
|
|
|
#ifdef _WIN32
|
|
# bound checking is not implemented
|
|
pop %rdx
|
|
mov %rcx,%rax
|
|
add $15,%rax
|
|
and $-16,%rax
|
|
jz p3
|
|
|
|
p1:
|
|
cmp $4096,%rax
|
|
jbe p2
|
|
test %rax,-4096(%rsp)
|
|
sub $4096,%rsp
|
|
sub $4096,%rax
|
|
jmp p1
|
|
p2:
|
|
|
|
sub %rax,%rsp
|
|
mov %rsp,%rax
|
|
add $32,%rax
|
|
|
|
p3:
|
|
push %rdx
|
|
ret
|
|
#else
|
|
pop %rdx
|
|
mov %rdi,%rax
|
|
mov %rax,%rsi # size, a second parm to the __bound_new_region
|
|
|
|
add $15,%rax
|
|
and $-16,%rax
|
|
jz p3
|
|
|
|
|
|
sub %rax,%rsp
|
|
mov %rsp,%rdi # pointer, a first parm to the __bound_new_region
|
|
mov %rsp,%rax
|
|
|
|
push %rdx
|
|
push %rax
|
|
call __bound_new_region
|
|
pop %rax
|
|
pop %rdx
|
|
|
|
p3:
|
|
push %rdx
|
|
ret
|
|
#endif
|
|
|
|
/* ---------------------------------------------- */
|