diff mbox

[2,23] BZ #18661: Align stack to 16 bytes when calling __gettimeofday

Message ID 20150804165053.GB1621@intel.com
State New
Headers show

Commit Message

H.J. Lu Aug. 4, 2015, 4:50 p.m. UTC
Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
to 16 bytes when calling __gettimeofday.

I am planning to check it in after 2.22 is branched.


H.J.
---
	[BZ #18661]
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
	(__lll_timedwait_tid): Align stack to 16 bytes when calling
	__gettimeofday.
---
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.S | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 0935db5..8e1a39d 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -394,8 +394,9 @@  __lll_timedwait_tid:
 	movq	%rdi, %r12
 	movq	%rsi, %r13
 
-	subq	$16, %rsp
-	cfi_adjust_cfa_offset(16)
+	/* Align stack to 16 bytes when calling __gettimeofday.  */
+	subq	$24, %rsp
+	cfi_adjust_cfa_offset(24)
 
 	/* Get current time.  */
 2:	movq	%rsp, %rdi
@@ -441,8 +442,8 @@  __lll_timedwait_tid:
 	jne	1f
 4:	xorl	%eax, %eax
 
-8:	addq	$16, %rsp
-	cfi_adjust_cfa_offset(-16)
+8:	addq	$24, %rsp
+	cfi_adjust_cfa_offset(-24)
 	popq	%r13
 	cfi_adjust_cfa_offset(-8)
 	cfi_restore(%r13)