|
From: <sv...@va...> - 2012-12-16 09:52:46
|
tom 2012-12-16 09:52:38 +0000 (Sun, 16 Dec 2012)
New Revision: 13182
Log:
Make sure the stack pointer is properly aligned when invoking a
signal on amd64-linux systems.
The amd64 ABI describes the required alignment on function entry
as follows:
"In other words, the value (%rsp − 8) is always a multiple
of 16 when control is transferred to the function entry point.
So we need to 16 byte align and then subtract an extra 8 bytes
to achieve the correct alignment.
Patch from fj...@gm... to fix BZ#280114.
Modified files:
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.c (+1 -1)
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2012-12-14 12:51:08 +00:00 (rev 13181)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2012-12-16 09:52:38 +00:00 (rev 13182)
@@ -452,7 +452,7 @@
UWord err;
rsp -= sizeof(*frame);
- rsp = VG_ROUNDDN(rsp, 16);
+ rsp = VG_ROUNDDN(rsp, 16) - 8;
frame = (struct rt_sigframe *)rsp;
if (!extend(tst, rsp, sizeof(*frame)))
|