Browse Source

Fix haltproc to retrieve the exit code from the passed parameter instead of manually accessing ExitCode

git-svn-id: branches/svenbarth/packages@32485 -
svenbarth 9 years ago
parent
commit
25bdcaecaa
1 changed files with 4 additions and 34 deletions
  1. 4 34
      rtl/linux/i386/si_prc.inc

+ 4 - 34
rtl/linux/i386/si_prc.inc

@@ -114,9 +114,9 @@ asm
 end;
 end;
 
 
 
 
-procedure _FPC_proc_haltproc; assembler; nostackframe; public name '_haltproc';
+procedure _FPC_proc_haltproc(e: longint); cdecl; assembler; nostackframe; public name '_haltproc';
 asm
 asm
-  addl  $12, %esp  { align stack back to 16 bytes }
+  //addl  $12, %esp  { align stack back to 16 bytes }
 .Lhaltproc:
 .Lhaltproc:
   {$ifdef FPC_PIC}
   {$ifdef FPC_PIC}
         call  fpc_geteipasebxlocal
         call  fpc_geteipasebxlocal
@@ -132,42 +132,12 @@ asm
 .Lnodlexitproc:
 .Lnodlexitproc:
   movl    syscall_nr_exit_group,%eax
   movl    syscall_nr_exit_group,%eax
 
 
-{$ifdef FPC_PIC}
-  call    fpc_geteipasebxlocal
-  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
 
 
   int     $0x80
   int     $0x80
   movl    syscall_nr_exit,%eax
   movl    syscall_nr_exit,%eax
 
 
-{$ifdef FPC_PIC}
-  call    fpc_geteipasebxlocal
-  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
 
 
   int     $0x80
   int     $0x80
   jmp     .Lhaltproc
   jmp     .Lhaltproc