aboutsummaryrefslogtreecommitdiff
path: root/x86_64-gen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2011-07-14 19:09:49 +0200
committergrischka <grischka>2011-07-14 19:09:49 +0200
commitdf4c0892f3fb5170042652cd648a29c94c3a2eca (patch)
tree0db41a085d08276f9804b4905949c60ff1f7500f /x86_64-gen.c
parent232650f8b3a786e82071c12a1ee8eea60684279a (diff)
downloadtinycc-df4c0892f3fb5170042652cd648a29c94c3a2eca.tar.gz
tinycc-df4c0892f3fb5170042652cd648a29c94c3a2eca.tar.bz2
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.
Diffstat (limited to 'x86_64-gen.c')
-rw-r--r--x86_64-gen.c7
1 files changed, 4 insertions, 3 deletions
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