mirror of
https://github.com/frida/tinycc
synced 2024-11-27 10:09:42 +03:00
6a4f3cf127
tested on win32/64 to pass the tests when enabled - libtcc.c : let tcc define __leading_underscore if enabled tcc_add_symbol() : add _ automatically - tccelf.c : remove tcc_get_symbol_err(), find_c_sym() currently symbol length is limited to 256 in several places, so we can use a fixed local buffer for now as well. - win32/lib/crtinit.c : new file for init/fini - lib/*.S, tests7* : use __leading_underscore - bt-log.c: this file wont work relibaly if compiled with gcc
52 lines
1.0 KiB
ArmAsm
52 lines
1.0 KiB
ArmAsm
/* ---------------------------------------------- */
|
|
/* alloca86_64.S */
|
|
|
|
#ifdef __leading_underscore
|
|
# define _(s) _##s
|
|
#else
|
|
# define _(s) s
|
|
#endif
|
|
|
|
.globl _(__bound_alloca)
|
|
_(__bound_alloca):
|
|
#ifdef _WIN32
|
|
inc %rcx # add one extra to separate regions
|
|
jmp _(alloca)
|
|
.globl _(__bound_alloca_nr)
|
|
_(__bound_alloca_nr):
|
|
dec %rcx
|
|
push %rax
|
|
mov %rcx,%rdx
|
|
mov %rax,%rcx
|
|
sub $32,%rsp
|
|
call _(__bound_new_region)
|
|
add $32,%rsp
|
|
pop %rax
|
|
ret
|
|
#else
|
|
pop %rdx
|
|
mov %rdi,%rax
|
|
mov %rax,%rsi # size, a second parm to the __bound_new_region
|
|
|
|
add $15 + 1,%rax # add one extra to separate regions
|
|
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
|
|
|
|
/* ---------------------------------------------- */
|