mirror of
https://github.com/frida/tinycc
synced 2024-11-28 02:29:38 +03:00
a4a20360e9
- tccgen.c/tcc.h: allow function declaration after use:
int f() { return g(); }
int g() { return 1; }
may be a warning but not an error
see also 76cb1144ef
- tccgen.c: redundant code related to inline functions removed
(functions used anywhere have sym->c set automatically)
- tccgen.c: make 32bit llop non-equal test portable
(probably not on C67)
- dynarray_add: change prototype to possibly avoid aliasing
problems or at least warnings
- lib/alloca*.S: ".section .note.GNU-stack,"",%progbits" removed
(has no effect)
- tccpe: set SizeOfCode field (for correct upx decompression)
- libtcc.c: fixed alternative -run invocation
tcc "-run -lxxx ..." file.c
(meant to load the library after file).
Also supported now:
tcc files ... options ... -run @ arguments ...
57 lines
982 B
ArmAsm
57 lines
982 B
ArmAsm
/* ---------------------------------------------- */
|
|
/* alloca86_64.S */
|
|
|
|
.globl __bound_alloca
|
|
__bound_alloca:
|
|
|
|
#ifdef TCC_TARGET_PE
|
|
# 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
|
|
|
|
/* ---------------------------------------------- */
|