aboutsummaryrefslogtreecommitdiff
path: root/x86_64-gen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2009-07-18 22:06:54 +0200
committergrischka <grischka>2009-07-18 22:06:54 +0200
commitfc977d56c90b6c6a54b7e831b5c88e37f54a5cae (patch)
tree51d2b865b88ba820373d8240377926bca63f857d /x86_64-gen.c
parentc0fc0fa0c4276debb7d0fd24f91e3af38128ad28 (diff)
downloadtinycc-fc977d56c90b6c6a54b7e831b5c88e37f54a5cae.tar.gz
tinycc-fc977d56c90b6c6a54b7e831b5c88e37f54a5cae.tar.bz2
x86-64: chkstk, alloca
Diffstat (limited to 'x86_64-gen.c')
-rw-r--r--x86_64-gen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/x86_64-gen.c b/x86_64-gen.c
index 19e8028..cc68e34 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -919,12 +919,13 @@ void gfunc_epilog(void)
v = (-loc + 15) & -16;
saved_ind = ind;
ind = func_sub_sp_offset - FUNC_PROLOG_SIZE;
-#if 0 // def TCC_TARGET_PE - don't have __chkstk yet, because assembler does not work
+#ifdef TCC_TARGET_PE
if (v >= 4096) {
Sym *sym = external_global_sym(TOK___chkstk, &func_old_type, 0);
oad(0xb8, v); /* mov stacksize, %eax */
oad(0xe8, -4); /* call __chkstk, (does the stackframe too) */
greloc(cur_text_section, sym, ind-4, R_X86_64_PC32);
+ o(0x90); /* fill for FUNC_PROLOG_SIZE = 11 bytes */
} else
#endif
{