25845f
commit bbab82c25da9b504c0804119840de7aeab0eeeba
25845f
Author: Andreas Schwab <schwab@suse.de>
25845f
Date:   Tue Aug 4 12:35:50 2015 +0200
25845f
25845f
    Properly terminate FDE in makecontext for ix86 (bug 18635)
25845f
25845f
Downstream never set test-xfail-tst-makecontext, so it is not removed by
25845f
this patch.
25845f
25845f
diff --git a/sysdeps/unix/sysv/linux/i386/makecontext.S b/sysdeps/unix/sysv/linux/i386/makecontext.S
25845f
index 106b865066d346b6..48643864b05568b0 100644
25845f
--- a/sysdeps/unix/sysv/linux/i386/makecontext.S
25845f
+++ b/sysdeps/unix/sysv/linux/i386/makecontext.S
25845f
@@ -83,6 +83,10 @@ ENTRY(__makecontext)
25845f
 #else
25845f
 	movl	$L(exitcode), (%edx)
25845f
 #endif
25845f
+	/* We need to terminate the FDE here instead of after ret because
25845f
+	   the unwinder looks at ra-1 for unwind information.  */
25845f
+	cfi_endproc
25845f
+
25845f
 	/* 'makecontext' returns no value.  */
25845f
 	ret
25845f
 
25845f
@@ -92,7 +96,6 @@ ENTRY(__makecontext)
25845f
 	   the context 'makecontext' manipulated at the time of the
25845f
 	   'makecontext' call.  If the pointer is NULL the process must
25845f
 	   terminate.  */
25845f
-	cfi_endproc
25845f
 L(exitcode):
25845f
 	/* This removes the parameters passed to the function given to
25845f
 	   'makecontext' from the stack.  EBX contains the number of