00db10
commit 8e1f346462d8c1b238a7c6bb501c45b381a45e4d
00db10
Author: H.J. Lu <hjl.tools@gmail.com>
00db10
Date:   Sun Jul 12 14:38:58 2015 -0700
00db10
00db10
    Align stack to 16 bytes when calling __setcontext
00db10
    
00db10
    Don't use pop to restore %rdi so that stack is aligned to 16 bytes
00db10
    when calling __setcontext.
00db10
    
00db10
            [BZ #18661]
00db10
            * sysdeps/unix/sysv/linux/x86_64/__start_context.S
00db10
            (__start_context): Don't use pop to restore %rdi so that stack
00db10
            is aligned to 16 bytes when calling __setcontext.
00db10
00db10
diff --git a/sysdeps/unix/sysv/linux/x86_64/__start_context.S b/sysdeps/unix/sysv/linux/x86_64/__start_context.S
00db10
index 9f2ee23736bfbf70..f59d6b4f7f3d3d43 100644
00db10
--- a/sysdeps/unix/sysv/linux/x86_64/__start_context.S
00db10
+++ b/sysdeps/unix/sysv/linux/x86_64/__start_context.S
00db10
@@ -31,8 +31,8 @@ ENTRY(__start_context)
00db10
 	   on the stack pointer for the next context.  */
00db10
 	movq	%rbx, %rsp
00db10
 
00db10
-	popq	%rdi			/* This is the next context.  */
00db10
-	cfi_adjust_cfa_offset(-8)
00db10
+	/* Don't use pop here so that stack is aligned to 16 bytes.  */
00db10
+	movq	(%rsp), %rdi		/* This is the next context.  */
00db10
 	testq	%rdi, %rdi
00db10
 	je	2f			/* If it is zero exit.  */
00db10