Skip to content

Commit

Permalink
Align stack to 16 bytes when calling __setcontext
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
H.J. Lu committed Aug 5, 2015
1 parent 3b8d2eb commit 8e1f346
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/unix/sysv/linux/x86_64/__start_context.S
Original file line number Diff line number Diff line change
Expand Up @@ -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. */

Expand Down

0 comments on commit 8e1f346

Please sign in to comment.