* fixed the haltproc for shared libs

git-svn-id: trunk@41763 -
This commit is contained in:
nickysn 2019-03-21 23:37:47 +00:00
parent 01669ebf70
commit b4baba3454

View File

@ -34,21 +34,12 @@ procedure _FPC_shared_lib_start; cdecl; public name 'FPC_LIB_START';
PascalMain;
end;
procedure _FPC_proc_haltproc; assembler; nostackframe; public name '_haltproc';
{ this routine is only called when the halt() routine of the RTL embedded in
the shared library is called }
procedure _FPC_shared_lib_haltproc; cdecl; assembler; nostackframe; public name '_haltproc';
asm
movq $1,%rax
movl operatingsystem_result(%rip),%ebx
pushq %rbx
call .Lactualsyscall
addq $8,%rsp
jmp _FPC_proc_haltproc
.Lactualsyscall:
int $0x80
jb .LErrorcode
xor %rbx,%rbx
ret
.LErrorcode:
movq %rax,%rbx
movq $-1,%rax
movl operatingsystem_result(%rip),%edi
syscall
jmp _FPC_shared_lib_haltproc
end;