From df4c0892f3fb5170042652cd648a29c94c3a2eca Mon Sep 17 00:00:00 2001 From: grischka Date: Thu, 14 Jul 2011 19:09:49 +0200 Subject: tccrun: win64: add unwind function table for dynamic code This works only when tcc.exe is compiled using MSC. MinGW does something in the startup code that defeats it. --- x86_64-gen.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'x86_64-gen.c') diff --git a/x86_64-gen.c b/x86_64-gen.c index 7c64f3b..247027a 100644 --- a/x86_64-gen.c +++ b/x86_64-gen.c @@ -772,8 +772,6 @@ void gfunc_epilog(void) /* align local size to word & save local variables */ v = (func_scratch + -loc + 15) & -16; - pe_add_unwind_data(ind, saved_ind, v); - if (v >= 4096) { Sym *sym = external_global_sym(TOK___chkstk, &func_old_type, 0); oad(0xb8, v); /* mov stacksize, %eax */ @@ -785,7 +783,10 @@ void gfunc_epilog(void) o(0xec8148); /* sub rsp, stacksize */ gen_le32(v); } - ind = saved_ind; + + cur_text_section->data_offset = saved_ind; + pe_add_unwind_data(ind, saved_ind, v); + ind = cur_text_section->data_offset; } #else -- cgit v1.3.1