arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1531168-1.patch

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