Browse Source

- Cleaned out some more assembler PIC hacks around ExitCode variable

git-svn-id: trunk@32680 -
sergei 9 years ago
parent
commit
903ddf8403
2 changed files with 5 additions and 41 deletions
  1. 3 22
      rtl/linux/i386/si_c.inc
  2. 2 19
      rtl/linux/i386/si_uc.inc

+ 3 - 22
rtl/linux/i386/si_c.inc

@@ -150,33 +150,14 @@ asm
   call    PASCALMAIN              { start the program }
 end;
 
-procedure _FPC_libc_haltproc; assembler; nostackframe; public name '_haltproc';
+procedure _FPC_libc_haltproc(e: longint); cdecl; assembler; public name '_haltproc';
 asm
 .Lhaltproc:
-
- {$ifdef FPC_PIC}
-  call    fpc_geteipasebx
-  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}
-
-  pushl   %ebx
-
+  pushl   e
   call    libc_exit
   xorl    %eax,%eax
   incl    %eax                    { eax=1, exit call }
-  popl    %ebx
+  movl    e,%ebx
   int     $0x80
   jmp     .Lhaltproc
 end;

+ 2 - 19
rtl/linux/i386/si_uc.inc

@@ -145,27 +145,10 @@ asm
 	hlt
 end;
 
-procedure _FPC_libc21_haltproc; assembler; nostackframe; public name '_haltproc';
+procedure _FPC_libc21_haltproc(e: longint); assembler; public name '_haltproc';
 asm
 .Lhaltproc:
-
-  {$ifdef FPC_PIC}
-        call    get3eipasebx
-        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
   pushl   %ebx
   call    uclibc_exit
   xorl    %eax,%eax