mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 09:06:02 +02:00
Fix PIC code
git-svn-id: trunk@36790 -
This commit is contained in:
parent
5491cf9519
commit
1c3996979a
@ -28,23 +28,25 @@ procedure _FPC_proc_start; assembler; nostackframe; public name '_start';
|
|||||||
{ space for arguments }
|
{ space for arguments }
|
||||||
sub %sp, 6*8, %sp
|
sub %sp, 6*8, %sp
|
||||||
{$ifdef FPC_PIC}
|
{$ifdef FPC_PIC}
|
||||||
|
sethi %hi(_GLOBAL_OFFSET_TABLE_-8),%l7
|
||||||
|
or %l7,%lo(_GLOBAL_OFFSET_TABLE_-4),%l7
|
||||||
call FPC_GETGOT
|
call FPC_GETGOT
|
||||||
nop
|
nop
|
||||||
{$endif FPC_PIC}
|
{$endif FPC_PIC}
|
||||||
{ extract argc }
|
{ extract argc }
|
||||||
ldx [%sp+STACK_BIAS+22*8], %o2
|
ldx [%sp+STACK_BIAS+22*8], %o2
|
||||||
{$ifdef FPC_PIC}
|
sethi %hi(operatingsystem_parameter_argc),%o1
|
||||||
{$else FPC_PIC}
|
|
||||||
sethi %hi(operatingsystem_parameter_argc),%o1
|
|
||||||
or %o1,%lo(operatingsystem_parameter_argc),%o1
|
or %o1,%lo(operatingsystem_parameter_argc),%o1
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
ldx [%o1+%l7],%o1
|
||||||
{$endif FPC_PIC}
|
{$endif FPC_PIC}
|
||||||
st %o2, [%o1]
|
st %o2, [%o1]
|
||||||
{ extract argv }
|
{ extract argv }
|
||||||
{$ifdef FPC_PIC}
|
|
||||||
{$else FPC_PIC}
|
|
||||||
add %sp, STACK_BIAS+23*8, %o0
|
add %sp, STACK_BIAS+23*8, %o0
|
||||||
sethi %hi(operatingsystem_parameter_argv),%o1
|
sethi %hi(operatingsystem_parameter_argv),%o1
|
||||||
or %o1,%lo(operatingsystem_parameter_argv),%o1
|
or %o1,%lo(operatingsystem_parameter_argv),%o1
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
ldx [%o1+%l7], %o1
|
||||||
{$endif FPC_PIC}
|
{$endif FPC_PIC}
|
||||||
stx %o0, [%o1]
|
stx %o0, [%o1]
|
||||||
|
|
||||||
@ -52,18 +54,18 @@ procedure _FPC_proc_start; assembler; nostackframe; public name '_start';
|
|||||||
inc %o2
|
inc %o2
|
||||||
sllx %o2, 3, %o2
|
sllx %o2, 3, %o2
|
||||||
add %o2, %o0, %o2
|
add %o2, %o0, %o2
|
||||||
{$ifdef FPC_PIC}
|
sethi %hi(operatingsystem_parameter_envp),%o1
|
||||||
{$else FPC_PIC}
|
|
||||||
sethi %hi(operatingsystem_parameter_envp),%o1
|
|
||||||
or %o1,%lo(operatingsystem_parameter_envp),%o1
|
or %o1,%lo(operatingsystem_parameter_envp),%o1
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
ldx [%o1+%l7], %o1
|
||||||
{$endif FPC_PIC}
|
{$endif FPC_PIC}
|
||||||
stx %o2, [%o1]
|
stx %o2, [%o1]
|
||||||
|
|
||||||
{ Save initial stackpointer }
|
{ Save initial stackpointer }
|
||||||
{$ifdef FPC_PIC}
|
sethi %hi(initialstkptr),%o1
|
||||||
{$else FPC_PIC}
|
|
||||||
sethi %hi(initialstkptr),%o1
|
|
||||||
or %o1,%lo(initialstkptr),%o1
|
or %o1,%lo(initialstkptr),%o1
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
ldx [%o1+%l7], %o1
|
||||||
{$endif FPC_PIC}
|
{$endif FPC_PIC}
|
||||||
stx %sp, [%o1]
|
stx %sp, [%o1]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user