- Win64, EXE_Entry: removed messing with gs:[0], it won't work anyway.

- Also don't modify rsp in the middle of procedure, x86_64 targets use fixed stack.
- Cleaned outdated FPC_HAS_RIP_RELATIVE and VER2_2 defines.

git-svn-id: trunk@19460 -
This commit is contained in:
sergei 2011-10-11 08:38:10 +00:00
parent b1b0b2bb1f
commit 1404b7397a

View File

@ -181,6 +181,7 @@ var
procedure Exe_entry;[public,alias:'_FPC_EXE_Entry']; procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
var var
ST : pointer; ST : pointer;
save_rbp: pointer;
begin begin
IsLibrary:=false; IsLibrary:=false;
{ install the handlers for exe only ? { install the handlers for exe only ?
@ -188,22 +189,7 @@ procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
install_exception_handlers; install_exception_handlers;
ExitCode:=0; ExitCode:=0;
asm asm
{ allocate space for an exception frame } movq %rbp,save_rbp
pushq $0
pushq %gs:(0)
{ movl %rsp,%gs:(0)
but don't insert it as it doesn't
point to anything yet
this will be used in signals unit }
movq %rsp,%rax
{$ifdef FPC_HAS_RIP_RELATIVE}
movq %rax,System_exception_frame(%rip)
{$else}
movq %rax,System_exception_frame
{$endif}
{ keep stack aligned }
pushq $0
pushq %rbp
movq %rsp,%rax movq %rsp,%rax
movq %rax,st movq %rax,st
end; end;
@ -211,15 +197,10 @@ procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
asm asm
xorq %rax,%rax xorq %rax,%rax
movw %ss,%ax movw %ss,%ax
{$ifdef FPC_HAS_RIP_RELATIVE}
movl %eax,_SS(%rip) movl %eax,_SS(%rip)
{$else}
movl %eax,_SS
{$endif}
xorq %rbp,%rbp xorq %rbp,%rbp
call PASCALMAIN call PASCALMAIN
popq %rbp movq save_rbp,%rbp
popq %rax
end; end;
{ if we pass here there was no error ! } { if we pass here there was no error ! }
system_exit; system_exit;
@ -642,9 +623,7 @@ begin
errno:=0; errno:=0;
initvariantmanager; initvariantmanager;
initwidestringmanager; initwidestringmanager;
{$ifndef VER2_2}
initunicodestringmanager; initunicodestringmanager;
{$endif VER2_2}
InitWin32Widestrings; InitWin32Widestrings;
DispCallByIDProc:=@DoDispCallByIDError; DispCallByIDProc:=@DoDispCallByIDError;
end. end.