mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 11:49:23 +02:00
- Cleaned out some more assembler PIC hacks around ExitCode variable
git-svn-id: trunk@32680 -
This commit is contained in:
parent
52402032ae
commit
903ddf8403
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user