mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 04:29:26 +02:00
- Cleaned out assembler hacks around ExitCode variable
git-svn-id: trunk@29559 -
This commit is contained in:
parent
e2eb6dffbb
commit
d6f5bcee45
@ -132,9 +132,8 @@ asm
|
|||||||
hlt
|
hlt
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure _FPC_libc21_haltproc; assembler; nostackframe; public name '_haltproc';
|
procedure _FPC_libc21_haltproc(e: longint); cdecl; assembler; public name '_haltproc';
|
||||||
asm
|
asm
|
||||||
.Lhaltproc:
|
|
||||||
{$ifdef FPC_PIC}
|
{$ifdef FPC_PIC}
|
||||||
call .Lpiclab
|
call .Lpiclab
|
||||||
.Lpiclab:
|
.Lpiclab:
|
||||||
@ -150,49 +149,12 @@ asm
|
|||||||
call *%eax
|
call *%eax
|
||||||
.Lnodlexitproc:
|
.Lnodlexitproc:
|
||||||
movl syscall_nr_exit_group,%eax
|
movl syscall_nr_exit_group,%eax
|
||||||
|
movl e,%ebx
|
||||||
{$ifdef FPC_PIC}
|
|
||||||
call .Lpiclab2
|
|
||||||
.Lpiclab2:
|
|
||||||
popl %ebx
|
|
||||||
addl $_GLOBAL_OFFSET_TABLE_+1,%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}
|
|
||||||
|
|
||||||
int $0x80
|
int $0x80
|
||||||
|
|
||||||
movl syscall_nr_exit,%eax
|
movl syscall_nr_exit,%eax
|
||||||
|
movl e,%ebx
|
||||||
{$ifdef FPC_PIC}
|
|
||||||
call .Lpiclab3
|
|
||||||
.Lpiclab3:
|
|
||||||
popl %ebx
|
|
||||||
addl $_GLOBAL_OFFSET_TABLE_+1,%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}
|
|
||||||
|
|
||||||
int $0x80
|
int $0x80
|
||||||
jmp .Lhaltproc
|
jmp .Lnodlexitproc
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user