mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:29:24 +02:00
Add replacement of $GCSECTIONS for shared libraries
git-svn-id: trunk@39403 -
This commit is contained in:
parent
3673f03841
commit
6cab9fd7db
@ -1435,6 +1435,7 @@ Function TLinkerLinux.MakeSharedLibrary:boolean;
|
|||||||
var
|
var
|
||||||
InitStr,
|
InitStr,
|
||||||
FiniStr,
|
FiniStr,
|
||||||
|
GCSectionsStr,
|
||||||
SoNameStr : string[80];
|
SoNameStr : string[80];
|
||||||
binstr,
|
binstr,
|
||||||
cmdstr : TCmdStr;
|
cmdstr : TCmdStr;
|
||||||
@ -1443,6 +1444,11 @@ begin
|
|||||||
MakeSharedLibrary:=false;
|
MakeSharedLibrary:=false;
|
||||||
if not(cs_link_nolink in current_settings.globalswitches) then
|
if not(cs_link_nolink in current_settings.globalswitches) then
|
||||||
Message1(exec_i_linking,current_module.sharedlibfilename);
|
Message1(exec_i_linking,current_module.sharedlibfilename);
|
||||||
|
if (cs_link_smart in current_settings.globalswitches) and
|
||||||
|
create_smartlink_sections then
|
||||||
|
GCSectionsStr:='--gc-sections'
|
||||||
|
else
|
||||||
|
GCSectionsStr:='';
|
||||||
|
|
||||||
{ Write used files and libraries }
|
{ Write used files and libraries }
|
||||||
WriteResponseFile(true);
|
WriteResponseFile(true);
|
||||||
@ -1461,6 +1467,7 @@ begin
|
|||||||
Replace(cmdstr,'$INIT',InitStr);
|
Replace(cmdstr,'$INIT',InitStr);
|
||||||
Replace(cmdstr,'$FINI',FiniStr);
|
Replace(cmdstr,'$FINI',FiniStr);
|
||||||
Replace(cmdstr,'$SONAME',SoNameStr);
|
Replace(cmdstr,'$SONAME',SoNameStr);
|
||||||
|
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
||||||
success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
|
success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
|
||||||
|
|
||||||
{ Strip the library ? }
|
{ Strip the library ? }
|
||||||
|
Loading…
Reference in New Issue
Block a user