From 2efa348b192d0a6959def13fa3b5e8678c9346ab Mon Sep 17 00:00:00 2001 From: sergei <gorelkin@nanoreflex.ru> Date: Mon, 26 Jan 2015 20:08:11 +0000 Subject: [PATCH] - Cleaned out more assembler hacks around ExitCode variable git-svn-id: trunk@29560 - --- rtl/linux/i386/si_prc.inc | 43 +++++---------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/rtl/linux/i386/si_prc.inc b/rtl/linux/i386/si_prc.inc index 41c49fef0b..f7783de509 100644 --- a/rtl/linux/i386/si_prc.inc +++ b/rtl/linux/i386/si_prc.inc @@ -116,10 +116,9 @@ asm end; -procedure _FPC_proc_haltproc; assembler; nostackframe; public name '_haltproc'; +procedure _FPC_proc_haltproc(e:longint); cdecl; assembler; public name '_haltproc'; asm - addl $12, %esp { align stack back to 16 bytes } -.Lhaltproc: + //addl $12, %esp { align stack back to 16 bytes } {$ifdef FPC_PIC} call fpc_geteipasebxlocal addl $_GLOBAL_OFFSET_TABLE_,%ebx @@ -134,44 +133,12 @@ asm .Lnodlexitproc: 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 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 - jmp .Lhaltproc + jmp .Lnodlexitproc end;