Browse Source

* fixed the haltproc for shared libs

git-svn-id: trunk@41763 -
nickysn 6 years ago
parent
commit
b4baba3454
1 changed files with 6 additions and 15 deletions
  1. 6 15
      rtl/openbsd/x86_64/si_dll.inc

+ 6 - 15
rtl/openbsd/x86_64/si_dll.inc

@@ -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;