mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 15:47:53 +02:00
Fix PIC code
git-svn-id: trunk@36791 -
This commit is contained in:
parent
1c3996979a
commit
dc0e8de99f
@ -37,23 +37,25 @@ procedure _FPC_libc_start; assembler; nostackframe; public name '_start';
|
||||
{ space for arguments }
|
||||
sub %sp, 6*8, %sp
|
||||
{$ifdef FPC_PIC}
|
||||
sethi %hi(_GLOBAL_OFFSET_TABLE_-8),%l7
|
||||
or %l7,%lo(_GLOBAL_OFFSET_TABLE_-4),%l7
|
||||
call FPC_GETGOT
|
||||
nop
|
||||
{$endif FPC_PIC}
|
||||
{ extract argc }
|
||||
ldx [%sp+STACK_BIAS+22*8], %o2
|
||||
{$ifdef FPC_PIC}
|
||||
{$else FPC_PIC}
|
||||
sethi %hi(operatingsystem_parameter_argc),%o1
|
||||
sethi %hi(operatingsystem_parameter_argc),%o1
|
||||
or %o1,%lo(operatingsystem_parameter_argc),%o1
|
||||
{$ifdef FPC_PIC}
|
||||
ldx [%o1+%l7],%o1
|
||||
{$endif FPC_PIC}
|
||||
st %o2, [%o1]
|
||||
{ extract argv }
|
||||
{$ifdef FPC_PIC}
|
||||
{$else FPC_PIC}
|
||||
add %sp, STACK_BIAS+23*8, %o0
|
||||
sethi %hi(operatingsystem_parameter_argv),%o1
|
||||
or %o1,%lo(operatingsystem_parameter_argv),%o1
|
||||
{$ifdef FPC_PIC}
|
||||
ldx [%o1+%l7],%o1
|
||||
{$endif FPC_PIC}
|
||||
stx %o0, [%o1]
|
||||
|
||||
@ -61,18 +63,18 @@ procedure _FPC_libc_start; assembler; nostackframe; public name '_start';
|
||||
inc %o2
|
||||
sllx %o2, 3, %o2
|
||||
add %o2, %o0, %o2
|
||||
{$ifdef FPC_PIC}
|
||||
{$else FPC_PIC}
|
||||
sethi %hi(operatingsystem_parameter_envp),%o1
|
||||
or %o1,%lo(operatingsystem_parameter_envp),%o1
|
||||
{$ifdef FPC_PIC}
|
||||
ldx [%o1+%l7],%o1
|
||||
{$endif FPC_PIC}
|
||||
stx %o2, [%o1]
|
||||
|
||||
{ Save initial stackpointer }
|
||||
{$ifdef FPC_PIC}
|
||||
{$else FPC_PIC}
|
||||
sethi %hi(initialstkptr),%o1
|
||||
or %o1,%lo(initialstkptr),%o1
|
||||
{$ifdef FPC_PIC}
|
||||
ldx [%o1+%l7],%o1
|
||||
{$endif FPC_PIC}
|
||||
stx %sp, [%o1]
|
||||
|
||||
@ -80,22 +82,22 @@ procedure _FPC_libc_start; assembler; nostackframe; public name '_start';
|
||||
ldx [%sp+STACK_BIAS+22*8], %o1
|
||||
add %sp, STACK_BIAS+23*8, %o0
|
||||
|
||||
{$ifdef FPC_PIC}
|
||||
{$else FPC_PIC}
|
||||
sethi %hi(PASCALMAIN), %o0
|
||||
or %o0, %lo(PASCALMAIN), %o0
|
||||
{$ifdef FPC_PIC}
|
||||
ldx [%o0+%l7],%o0
|
||||
{$endif FPC_PIC}
|
||||
|
||||
{$ifdef FPC_PIC}
|
||||
{$else FPC_PIC}
|
||||
sethi %hi(libc_init_proc), %o3
|
||||
or %o3, %lo(libc_init_proc), %o3
|
||||
{$ifdef FPC_PIC}
|
||||
ldx [%o3+%l7],%o3
|
||||
{$endif FPC_PIC}
|
||||
|
||||
{$ifdef FPC_PIC}
|
||||
{$else FPC_PIC}
|
||||
sethi %hi(libc_fini_proc), %o4
|
||||
or %o4, %lo(libc_fini_proc), %o4
|
||||
{$ifdef FPC_PIC}
|
||||
ldx [%o4+%l7],%o4
|
||||
{$endif FPC_PIC}
|
||||
|
||||
{ shared library termination function }
|
||||
|
Loading…
Reference in New Issue
Block a user