mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 02:48:14 +02:00
* provide __libc_csu_init and __libc_csu_fini as weak symbols
This commit is contained in:
parent
191dd0c637
commit
35a7490ae1
@ -52,6 +52,24 @@ procedure libc_start_main; external name '__libc_start_main';
|
||||
|
||||
procedure _FPC_libc_haltproc(e:longint); forward;
|
||||
|
||||
procedure ___libc_csu_init; external name '__libc_csu_init';
|
||||
|
||||
{$if FPC_FULLVERSION>30202}
|
||||
procedure __libc_csu_init; public name '__libc_csu_init'; assembler;
|
||||
asm
|
||||
.weak __libc_csu_init
|
||||
end;
|
||||
{$endif FPC_FULLVERSION>30202}
|
||||
|
||||
procedure ___libc_csu_fini; external name '__libc_csu_fini';
|
||||
|
||||
{$if FPC_FULLVERSION>30202}
|
||||
procedure __libc_csu_fini; public name '__libc_csu_fini'; assembler;
|
||||
asm
|
||||
.weak __libc_csu_fini
|
||||
end;
|
||||
{$endif FPC_FULLVERSION>30202}
|
||||
|
||||
procedure main_stub; assembler; nostackframe;
|
||||
asm
|
||||
{ save return address }
|
||||
@ -155,8 +173,8 @@ procedure _FPC_libc_start; assembler; nostackframe; public name '_start';
|
||||
pushq %rsp
|
||||
|
||||
{ Pass address of our own entry points to .fini and .init. }
|
||||
movq ini_dummy@GOTPCREL(%rip), %r8
|
||||
movq ini_dummy@GOTPCREL(%rip), %rcx
|
||||
movq ___libc_csu_fini@GOTPCREL(%rip), %r8
|
||||
movq ___libc_csu_init@GOTPCREL(%rip), %rcx
|
||||
|
||||
movq main_stub@GOTPCREL(%rip), %rdi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user