morphos: support section GC with GNU LD as well

git-svn-id: trunk@41105 -
This commit is contained in:
Károly Balogh 2019-01-29 05:02:18 +00:00
parent 7817e48e9a
commit d1878fe5b2

View File

@ -69,7 +69,7 @@ begin
begin
if not UseVLink then
begin
ExeCmd[1]:='ld $OPT -o $EXE $RES';
ExeCmd[1]:='ld $OPT $GCSECTIONS -o $EXE $RES';
ExeCmd[2]:='strip --strip-unneeded --remove-section .comment $EXE';
end
else
@ -223,6 +223,11 @@ begin
StripStr:='-s -P __abox__';
if create_smartlink_sections then
GCSectionsStr:='-gc-all -sc -sd';
end
else
begin
if create_smartlink_sections then
GCSectionsStr:='--gc-sections -e _start';
end;
{ Write used files and libraries }
@ -242,6 +247,7 @@ begin
begin
Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(current_module.exefilename)));
Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
end;
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);