mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 07:39:13 +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 }
|
call PASCALMAIN { start the program }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure _FPC_libc_haltproc; assembler; nostackframe; public name '_haltproc';
|
procedure _FPC_libc_haltproc(e: longint); cdecl; assembler; public name '_haltproc';
|
||||||
asm
|
asm
|
||||||
.Lhaltproc:
|
.Lhaltproc:
|
||||||
|
pushl e
|
||||||
{$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
|
|
||||||
|
|
||||||
call libc_exit
|
call libc_exit
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
incl %eax { eax=1, exit call }
|
incl %eax { eax=1, exit call }
|
||||||
popl %ebx
|
movl e,%ebx
|
||||||
int $0x80
|
int $0x80
|
||||||
jmp .Lhaltproc
|
jmp .Lhaltproc
|
||||||
end;
|
end;
|
||||||
|
@ -145,27 +145,10 @@ asm
|
|||||||
hlt
|
hlt
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure _FPC_libc21_haltproc; assembler; nostackframe; public name '_haltproc';
|
procedure _FPC_libc21_haltproc(e: longint); assembler; public name '_haltproc';
|
||||||
asm
|
asm
|
||||||
.Lhaltproc:
|
.Lhaltproc:
|
||||||
|
movl e,%ebx
|
||||||
{$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}
|
|
||||||
|
|
||||||
pushl %ebx
|
pushl %ebx
|
||||||
call uclibc_exit
|
call uclibc_exit
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
|
Loading…
Reference in New Issue
Block a user