* properly retrieve the stacktop on win64

git-svn-id: trunk@21926 -
This commit is contained in:
florian 2012-07-17 19:47:35 +00:00
parent 6cc78635d7
commit a6a1f2a0a1

View File

@ -194,8 +194,6 @@ end;
procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
var
ST : pointer;
begin
IsLibrary:=false;
{ install the handlers for exe only ?
@ -204,11 +202,6 @@ procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
install_exception_handlers;
{$endif FPC_USE_WIN64_SEH}
ExitCode:=0;
asm
movq %rsp,%rax
movq %rax,st
end;
StackTop:=st;
asm
xorq %rax,%rax
movw %ss,%ax
@ -504,8 +497,15 @@ asm
subq %gs:(16),%rax
end;
var
st : Pointer;
begin
asm
movq %gs:(8),%rax
movq %rax,st
end;
StackTop:=st;
{ pass dummy value }
StackLength := CheckInitialStkLen($1000000);
StackBottom := StackTop - StackLength;