|
From: <sv...@va...> - 2005-09-12 09:39:43
|
Author: tom
Date: 2005-09-12 10:39:37 +0100 (Mon, 12 Sep 2005)
New Revision: 4623
Log:
Fix the amd64 startup code and remove a redundant instruction from
the x86 startup 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-09-12 02:40:24 UTC (rev 4622=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-09-12 09:39:37 UTC (rev 4623=
)
@@ -2760,7 +2760,6 @@
"\t.globl _start\n"
"\t.type _start,@function\n"
"_start:\n"
- "\tmovl %esp,%eax\n"
/* set up the new stack in %eax */
"\tmovl $vgPlain_the_root_stack, %eax\n"
"\taddl $"VG_STRINGIFY(VG_STACK_GUARD_SZB)", %eax\n"
@@ -2779,8 +2778,14 @@
"\t.globl _start\n"
"\t.type _start,@function\n"
"_start:\n"
- "\tmovq %rsp,%rdi\n" /* Pass pointer to argc to _start_in_C */
- "\tandq $~15,%rsp\n" /* Make sure stack is 16 byte aligned */
+ /* set up the new stack in %rdi */
+ "\tmovq $vgPlain_the_root_stack, %rdi\n"
+ "\taddq $"VG_STRINGIFY(VG_STACK_GUARD_SZB)", %rdi\n"
+ "\taddq $"VG_STRINGIFY(VG_STACK_ACTIVE_SZB)", %rdi\n"
+ "\tandq $~15, %rdi\n"
+ /* install it, and collect the original one */
+ "\txchgq %rdi, %rsp\n"
+ /* call _start_in_C, passing it the startup %rsp */
"\tcall _start_in_C\n"
"\thlt\n"
);
|