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