Browse Source

- Cleaned out assembler hacks around ExitCode variable

git-svn-id: trunk@29559 -
sergei 10 years ago
parent
commit
d6f5bcee45
1 changed files with 5 additions and 43 deletions
  1. 5 43
      rtl/linux/i386/si_c21.inc

+ 5 - 43
rtl/linux/i386/si_c21.inc

@@ -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
-
-{$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}
-
+  movl    e,%ebx
   int     $0x80
   int     $0x80
-  movl    syscall_nr_exit,%eax
 
 
-{$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}
+  movl    syscall_nr_exit,%eax
+  movl    e,%ebx
 
 
   int     $0x80
   int     $0x80
-  jmp     .Lhaltproc
+  jmp     .Lnodlexitproc
 end;
 end;