|
From: <sv...@va...> - 2005-08-27 14:21:49
|
Author: tom
Date: 2005-08-27 15:21:41 +0100 (Sat, 27 Aug 2005)
New Revision: 4536
Log:
Make sure _start provides a 16 byte aligned stack to the C code.
Modified:
branches/ASPACEM/coregrind/m_main.c
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-27 13:46:23 UTC (rev 4535=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-27 14:21:41 UTC (rev 4536=
)
@@ -2939,7 +2939,11 @@
"\t.type _start,@function\n"
"_start:\n"
"\tmovl %esp,%eax\n"
- "\tpushl %eax\n"
+ "\tandl $~15,%esp\n" /* Make sure stack is 16 byte aligned */
+ "\tpushl %eax\n" /* Push junk to preserve alignment */
+ "\tpushl %eax\n" /* Push junk to preserve alignment */
+ "\tpushl %eax\n" /* Push junk to preserve alignment */
+ "\tpushl %eax\n" /* Pass pointer to argc to _start_in_C */
"\tcall _start_in_C\n"
"\thlt\n"
);
@@ -2948,7 +2952,8 @@
"\t.globl _start\n"
"\t.type _start,@function\n"
"_start:\n"
- "\tmovq %rsp,%rdi\n"
+ "\tmovq %rsp,%rdi\n" /* Pass pointer to argc to _start_in_C */
+ "\tandq $~15,%rsp\n" /* Make sure stack is 16 byte aligned */
"\tcall _start_in_C\n"
"\thlt\n"
);
|