mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 05:59:08 +02:00
* correct problem for -init -fini for scripts
git-svn-id: trunk@14811 -
This commit is contained in:
parent
a8381c8b32
commit
fbba2e89f8
@ -556,18 +556,39 @@ begin
|
|||||||
WriteResponseFile(true);
|
WriteResponseFile(true);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
|
{ initname and fininame may contain $, which can be wrongly interpreted
|
||||||
|
in a link script, thus we surround them with single quotes
|
||||||
|
in cs_link_nolink is in globalswitches }
|
||||||
if use_gnu_ld then
|
if use_gnu_ld then
|
||||||
begin
|
begin
|
||||||
InitFiniStr:='-init '+exportlib.initname;
|
InitFiniStr:='-init ';
|
||||||
|
if cs_link_nolink in current_settings.globalswitches then
|
||||||
|
InitFiniStr:=InitFiniStr+''''+exportlib.initname+''''
|
||||||
|
else
|
||||||
|
InitFiniStr:=InitFiniStr+exportlib.initname;
|
||||||
if (exportlib.fininame<>'') then
|
if (exportlib.fininame<>'') then
|
||||||
|
begin
|
||||||
|
if cs_link_nolink in current_settings.globalswitches then
|
||||||
|
InitFiniStr:=InitFiniStr+' -fini '''+exportlib.initname+''''
|
||||||
|
else
|
||||||
InitFiniStr:=InitFiniStr+' -fini '+exportlib.fininame;
|
InitFiniStr:=InitFiniStr+' -fini '+exportlib.fininame;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
InitFiniStr:='-z initarray='+exportlib.initname;
|
InitFiniStr:='-z initarray=';
|
||||||
|
if cs_link_nolink in current_settings.globalswitches then
|
||||||
|
InitFiniStr:=InitFiniStr+''''+exportlib.initname+''''
|
||||||
|
else
|
||||||
|
InitFiniStr:=InitFiniStr+exportlib.initname;
|
||||||
if (exportlib.fininame<>'') then
|
if (exportlib.fininame<>'') then
|
||||||
|
begin
|
||||||
|
if cs_link_nolink in current_settings.globalswitches then
|
||||||
|
InitFiniStr:=InitFiniStr+' -z finiarray='''+exportlib.initname+''''
|
||||||
|
else
|
||||||
InitFiniStr:=InitFiniStr+' -z finiarray='+exportlib.fininame;
|
InitFiniStr:=InitFiniStr+' -z finiarray='+exportlib.fininame;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ Call linker }
|
{ Call linker }
|
||||||
if use_gnu_ld then
|
if use_gnu_ld then
|
||||||
|
Loading…
Reference in New Issue
Block a user