]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Align stack to 16 bytes when calling __setcontext
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 12 Jul 2015 21:38:58 +0000 (14:38 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 5 Aug 2015 15:36:12 +0000 (08:36 -0700)
Don't use pop to restore %rdi so that stack is aligned to 16 bytes
when calling __setcontext.

[BZ #18661]
* sysdeps/unix/sysv/linux/x86_64/__start_context.S
(__start_context): Don't use pop to restore %rdi so that stack
is aligned to 16 bytes when calling __setcontext.

ChangeLog
sysdeps/unix/sysv/linux/x86_64/__start_context.S

index cec13dc871c225405a0eb7246c106eca8ff567ee..8a47768e034b69e8cc10869b136559c16d6ab4a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-08-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #18661]
+       * sysdeps/unix/sysv/linux/x86_64/__start_context.S
+       (__start_context): Don't use pop to restore %rdi so that stack
+       is aligned to 16 bytes when calling __setcontext.
+
 2015-08-05  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Compile
index 52a5afa9a62579391ed4ebc6d873ac1a523b8350..96366e053651467900934e4f8c2ed9a1797637a5 100644 (file)
@@ -31,8 +31,8 @@ ENTRY(__start_context)
           on the stack pointer for the next context.  */
        movq    %rbx, %rsp
 
-       popq    %rdi                    /* This is the next context.  */
-       cfi_adjust_cfa_offset(-8)
+       /* Don't use pop here so that stack is aligned to 16 bytes.  */
+       movq    (%rsp), %rdi            /* This is the next context.  */
        testq   %rdi, %rdi
        je      2f                      /* If it is zero exit.  */