mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 16:09:25 +02:00
* link to crtbegin.o/crtend.o instead of crtbeginS.o/crtendS.o when creating
normal OpenBSD programs (not shared libraries) that link to the C library, even when PIC code generation has been turned on. This is what gcc and clang do on this platform. git-svn-id: trunk@41740 -
This commit is contained in:
parent
d1a91a380b
commit
34a8032e11
@ -616,7 +616,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
if librarysearchpath.FindFile('crti.o',false,s) then
|
if librarysearchpath.FindFile('crti.o',false,s) then
|
||||||
LinkRes.AddFileName(s);
|
LinkRes.AddFileName(s);
|
||||||
if cs_create_pic in current_settings.moduleswitches then
|
if ((cs_create_pic in current_settings.moduleswitches) and
|
||||||
|
not (target_info.system in systems_openbsd)) or
|
||||||
|
(current_module.islibrary and
|
||||||
|
(target_info.system in systems_openbsd)) then
|
||||||
begin
|
begin
|
||||||
if librarysearchpath.FindFile('crtbeginS.o',false,s) then
|
if librarysearchpath.FindFile('crtbeginS.o',false,s) then
|
||||||
LinkRes.AddFileName(s);
|
LinkRes.AddFileName(s);
|
||||||
@ -740,7 +743,10 @@ begin
|
|||||||
if linklibc and
|
if linklibc and
|
||||||
not IsDarwin Then
|
not IsDarwin Then
|
||||||
begin
|
begin
|
||||||
if cs_create_pic in current_settings.moduleswitches then
|
if ((cs_create_pic in current_settings.moduleswitches) and
|
||||||
|
not (target_info.system in systems_openbsd)) or
|
||||||
|
(current_module.islibrary and
|
||||||
|
(target_info.system in systems_openbsd)) then
|
||||||
Fl1:=librarysearchpath.FindFile('crtendS.o',false,s1)
|
Fl1:=librarysearchpath.FindFile('crtendS.o',false,s1)
|
||||||
else
|
else
|
||||||
Fl1:=librarysearchpath.FindFile('crtend.o',false,s1);
|
Fl1:=librarysearchpath.FindFile('crtend.o',false,s1);
|
||||||
|
@ -28,7 +28,7 @@ var
|
|||||||
procedure _mcleanup; cdecl; external name '_mcleanup';
|
procedure _mcleanup; cdecl; external name '_mcleanup';
|
||||||
function atexit(proc: TCdeclProcedure): cint; cdecl; external name 'atexit';
|
function atexit(proc: TCdeclProcedure): cint; cdecl; external name 'atexit';
|
||||||
procedure monstartup(lowpc, highpc: u_long); cdecl; external name 'monstartup';
|
procedure monstartup(lowpc, highpc: u_long); cdecl; external name 'monstartup';
|
||||||
procedure _init; cdecl; external name '_init';
|
procedure __init; cdecl; external name '__init';
|
||||||
|
|
||||||
procedure _FPC_proc___start(argc: LongInt; argv: PPChar; envp: Pointer; para1, para2, para3: QWord); forward;
|
procedure _FPC_proc___start(argc: LongInt; argv: PPChar; envp: Pointer; para1, para2, para3: QWord); forward;
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ procedure _FPC_proc___start(argc: LongInt; argv: PPChar; envp: Pointer; para1, p
|
|||||||
end;
|
end;
|
||||||
atexit(@_mcleanup);
|
atexit(@_mcleanup);
|
||||||
monstartup(u_long(@_eprol),u_long(@_etext));
|
monstartup(u_long(@_eprol),u_long(@_etext));
|
||||||
_init;
|
__init;
|
||||||
PascalMain;
|
PascalMain;
|
||||||
asm
|
asm
|
||||||
jmp _FPC_proc_haltproc
|
jmp _FPC_proc_haltproc
|
||||||
|
Loading…
Reference in New Issue
Block a user