mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-05 08:09:52 +01:00
* fixed compilation after introduction of nostackframe checks
git-svn-id: trunk@22767 -
This commit is contained in:
parent
0b404fea69
commit
20a6b7fa3d
@ -54,17 +54,13 @@ Procedure fpc_geteipasebx;[external name 'fpc_geteipasebx'];
|
||||
{$asmmode ATT}
|
||||
|
||||
procedure _FPC_libc_start; assembler; nostackframe; public name '_start';
|
||||
var
|
||||
_ebx: LongInt;
|
||||
_ecx: LongInt;
|
||||
_libc_init_proc: LongInt;
|
||||
asm
|
||||
{ First locate the start of the environment variables }
|
||||
popl %ecx { Get argc in ecx }
|
||||
|
||||
{$ifdef FPC_PIC}
|
||||
movl %esp,_ebx { Points to the arguments }
|
||||
movl %ecx,_ecx
|
||||
movl %esp,%ebp { Points to the arguments }
|
||||
movl %ecx,%esi
|
||||
{$else FPC_PIC}
|
||||
movl %esp,%ebx { Points to the arguments }
|
||||
{$endif FPC_PIC}
|
||||
@ -83,15 +79,15 @@ asm
|
||||
|
||||
pushl %eax
|
||||
movl operatingsystem_parameter_argc@GOT(%ebx),%ecx
|
||||
movl _ecx,%eax
|
||||
movl %esi,%eax
|
||||
movl %eax,(%ecx)
|
||||
movl operatingsystem_parameter_argv@GOT(%ebx),%ecx
|
||||
movl _ebx,%eax
|
||||
movl %ebp,%eax
|
||||
movl %eax,(%ecx)
|
||||
popl %eax
|
||||
|
||||
popl %ecx
|
||||
movl _ebx,%ebx
|
||||
movl %ebp,%ebx
|
||||
{$else FPC_PIC}
|
||||
movl %eax,operatingsystem_parameter_envp { Move the environment pointer }
|
||||
movl %ecx,operatingsystem_parameter_argc { Move the argument counter }
|
||||
@ -112,8 +108,7 @@ asm
|
||||
call fpc_geteipasebx
|
||||
addl $_GLOBAL_OFFSET_TABLE_,%ebx
|
||||
movl libc_init_proc@GOT(%ebx),%ecx
|
||||
movl (%ecx),%ecx
|
||||
movl %ecx,_libc_init_proc
|
||||
movl (%ecx),%edi
|
||||
popl %ebx
|
||||
popl %ecx
|
||||
{$else FPC_PIC}
|
||||
@ -129,7 +124,7 @@ asm
|
||||
popl %eax
|
||||
|
||||
{$ifdef FPC_PIC}
|
||||
call _libc_init_proc
|
||||
call *%edi
|
||||
{$else FPC_PIC}
|
||||
call libc_init_proc
|
||||
{$endif FPC_PIC}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user