- Cleaned out some more assembler PIC hacks around ExitCode variable

git-svn-id: trunk@32680 -
This commit is contained in:
sergei 2015-12-18 11:49:20 +00:00
parent 52402032ae
commit 903ddf8403
2 changed files with 5 additions and 41 deletions

View File

@ -150,33 +150,14 @@ asm
call PASCALMAIN { start the program }
end;
procedure _FPC_libc_haltproc; assembler; nostackframe; public name '_haltproc';
procedure _FPC_libc_haltproc(e: longint); cdecl; assembler; public name '_haltproc';
asm
.Lhaltproc:
{$ifdef FPC_PIC}
call fpc_geteipasebx
addl $_GLOBAL_OFFSET_TABLE_,%ebx
movl ExitCode@GOT(%ebx),%ebx
{$if sizeof(ExitCode)=2}
movzwl (%ebx),%ebx
{$else}
mov (%ebx),%ebx
{$endif}
{$else FPC_PIC}
{$if sizeof(ExitCode)=2}
movzwl ExitCode,%ebx
{$else}
mov ExitCode,%ebx
{$endif}
{$endif FPC_PIC}
pushl %ebx
pushl e
call libc_exit
xorl %eax,%eax
incl %eax { eax=1, exit call }
popl %ebx
movl e,%ebx
int $0x80
jmp .Lhaltproc
end;

View File

@ -145,27 +145,10 @@ asm
hlt
end;
procedure _FPC_libc21_haltproc; assembler; nostackframe; public name '_haltproc';
procedure _FPC_libc21_haltproc(e: longint); assembler; public name '_haltproc';
asm
.Lhaltproc:
{$ifdef FPC_PIC}
call get3eipasebx
addl $_GLOBAL_OFFSET_TABLE_,%ebx
movl ExitCode@GOT(%ebx),%ebx
{$if sizeof(ExitCode)=2}
movzwl (%ebx),%ebx
{$else}
mov (%ebx),%ebx
{$endif}
{$else FPC_PIC}
{$if sizeof(ExitCode)=2}
movzwl ExitCode,%ebx
{$else}
mov ExitCode,%ebx
{$endif}
{$endif FPC_PIC}
movl e,%ebx
pushl %ebx
call uclibc_exit
xorl %eax,%eax