From 50b040ef83252730d75463bdeea589294e698532 Mon Sep 17 00:00:00 2001 From: grischka Date: Sat, 19 Dec 2009 22:40:28 +0100 Subject: win64: add tiny unwind data for setjmp/longjmp This enables native unwind semantics with longjmp on win64 by putting an entry into the .pdata section for each compiled fuction. Also, the function now use a fixed stack and store arguments into X(%rsp) rather than using push. --- win32/lib/chkstk.S | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'win32/lib/chkstk.S') diff --git a/win32/lib/chkstk.S b/win32/lib/chkstk.S index 90a6f0d..a757b16 100644 --- a/win32/lib/chkstk.S +++ b/win32/lib/chkstk.S @@ -57,11 +57,19 @@ P0: jmp *8(%rax) /* ---------------------------------------------- */ -/* avoid msvcrt unwind stuff for setjmp/longjmp */ +/* setjmp/longjmp support */ -.globl tinyc_getsp -tinyc_getsp: +.globl tinyc_no_getbp +tinyc_no_getbp: + .byte 0x90 + +.globl tinyc_getbp +tinyc_getbp: xor %rax,%rax + cmp %al,tinyc_no_getbp(%rax) + je t1 + mov %rbp,%rax +t1: ret /* ---------------------------------------------- */ -- cgit v1.3.1