Skip to content

Commit

Permalink
Align stack to 16 bytes when calling __gettimeofday
Browse files Browse the repository at this point in the history
Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
to 16 bytes when calling __gettimeofday.

	[BZ #18661]
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
	(__lll_timedwait_tid): Align stack to 16 bytes when calling
	__gettimeofday.
  • Loading branch information
H.J. Lu committed Aug 5, 2015
1 parent 8e1f346 commit b4425b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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/lowlevellock.S
(__lll_timedwait_tid): Align stack to 16 bytes when calling
__gettimeofday.

2015-08-05 H.J. Lu <hongjiu.lu@intel.com>

[BZ #18661]
Expand Down
9 changes: 5 additions & 4 deletions sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b4425b9

Please sign in to comment.