From ed1ca2777c35fe2f2751de255df3e16f17bdbd8d Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 24 Nov 2014 13:02:03 +0100 Subject: [PATCH] x86: Remove use of .cfi_escape The unwind info isn't 100% correct at all points during the epilogue, and not annotating is just as incorrect as the annotation. This works better on systems that do not support DW_OP_call_frame_cfa. --- src/x86/sysv.S | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/x86/sysv.S b/src/x86/sysv.S index bb9d568f..f7373715 100644 --- a/src/x86/sysv.S +++ b/src/x86/sysv.S @@ -405,16 +405,11 @@ C(ffi_closure_STDCALL): movl closure_FS(%esp), %edx /* move return address */ movl %edx, (%ecx) - /* New pseudo-stack frame based off ecx. This is unwind trickery - in that the CFA *has* changed, to the proper popped stack address. - Note that the location to which we moved the return address - is the new CFA-4, so that's unchanged. */ - cfi_def_cfa(%ecx, 4) - /* Normally esp is unwound to CFA + the caller's ARGS_SIZE. - We've just set the CFA to that final value. Tell the unwinder - to restore esp from CFA without the ARGS_SIZE: - DW_CFA_val_expression %esp, DW_OP_call_frame_cfa. */ - cfi_escape(0x16, 4, 1, 0x9c) + /* From this point on, the value of %esp upon return is %ecx+4, + and we've copied the return address to %ecx to make return easy. + There's no point in representing this in the unwind info, as + there is always a window between the mov and the ret which + will be wrong from one point of view or another. */ FFI_CLOSURE_MASK_AND_JUMP