From fc977d56c90b6c6a54b7e831b5c88e37f54a5cae Mon Sep 17 00:00:00 2001 From: grischka Date: Sat, 18 Jul 2009 22:06:54 +0200 Subject: x86-64: chkstk, alloca --- x86_64-gen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'x86_64-gen.c') 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 { -- cgit v1.3.1