mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 11:59:19 +02:00
amiga: section smartlinking support for amiga. needs vlink nightly
git-svn-id: trunk@35243 -
This commit is contained in:
parent
48de52f41b
commit
48744d0abd
@ -97,7 +97,7 @@ unit i_amiga;
|
|||||||
system : system_powerpc_Amiga;
|
system : system_powerpc_Amiga;
|
||||||
name : 'AmigaOS for PowerPC';
|
name : 'AmigaOS for PowerPC';
|
||||||
shortname : 'amiga';
|
shortname : 'amiga';
|
||||||
flags : [tf_files_case_aware,tf_requires_proper_alignment,tf_has_winlike_resources];
|
flags : [tf_files_case_aware,tf_requires_proper_alignment,tf_has_winlike_resources,tf_smartlink_sections];
|
||||||
cpu : cpu_powerpc;
|
cpu : cpu_powerpc;
|
||||||
unit_env : 'AMIGAUNITS';
|
unit_env : 'AMIGAUNITS';
|
||||||
extradefines : 'PPC603;HASAMIGA;AMIGAOS4';
|
extradefines : 'PPC603;HASAMIGA;AMIGAOS4';
|
||||||
|
@ -52,7 +52,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
cutils,cfileutl,cclasses,
|
cutils,cfileutl,cclasses,aasmbase,
|
||||||
globtype,globals,systems,verbose,script,fmodule,i_amiga;
|
globtype,globals,systems,verbose,script,fmodule,i_amiga;
|
||||||
|
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ExeCmd[1]:='vlink -b amigahunk $OPT $STRIP -o $EXE -T $RES';
|
ExeCmd[1]:='vlink -b amigahunk $GCSECTIONS $OPT $STRIP -o $EXE -T $RES';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -97,7 +97,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ExeCmd[1]:='vlink -q -n -b elf32amigaos -P_start -P__amigaos4__ -nostdlib $OPT $STRIP -o $EXE -T $RES';
|
ExeCmd[1]:='vlink -q -n -b elf32amigaos -P_start -P__amigaos4__ -nostdlib $GCSECTIONS $OPT $STRIP -o $EXE -T $RES';
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -346,9 +346,21 @@ var
|
|||||||
CmdStr : TCmdStr;
|
CmdStr : TCmdStr;
|
||||||
StripStr: string[40];
|
StripStr: string[40];
|
||||||
DynLinkStr : string;
|
DynLinkStr : string;
|
||||||
|
GCSectionsStr : string;
|
||||||
begin
|
begin
|
||||||
StripStr:='';
|
StripStr:='';
|
||||||
if (cs_link_strip in current_settings.globalswitches) then StripStr:='-s';
|
GCSectionsStr:='';
|
||||||
|
DynLinkStr:='';
|
||||||
|
|
||||||
|
if (cs_link_strip in current_settings.globalswitches) then
|
||||||
|
StripStr:='-s';
|
||||||
|
if rlinkpath<>'' Then
|
||||||
|
DynLinkStr:='--rpath-link '+rlinkpath;
|
||||||
|
if UseVLink then
|
||||||
|
begin
|
||||||
|
if create_smartlink_sections then
|
||||||
|
GCSectionsStr:='-gc-all -sc -sd';
|
||||||
|
end;
|
||||||
|
|
||||||
{ Call linker }
|
{ Call linker }
|
||||||
SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
|
SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
|
||||||
@ -357,11 +369,9 @@ begin
|
|||||||
Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
|
Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
|
||||||
Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
|
Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
|
||||||
Replace(cmdstr,'$STRIP',StripStr);
|
Replace(cmdstr,'$STRIP',StripStr);
|
||||||
if rlinkpath<>'' Then
|
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
||||||
DynLinkStr:='--rpath-link '+rlinkpath
|
|
||||||
else
|
|
||||||
DynLinkStr:='';
|
|
||||||
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
||||||
|
|
||||||
MakeAmiga68kExe:=DoExec(BinStr,CmdStr,true,false);
|
MakeAmiga68kExe:=DoExec(BinStr,CmdStr,true,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -372,9 +382,21 @@ var
|
|||||||
CmdStr : TCmdStr;
|
CmdStr : TCmdStr;
|
||||||
StripStr: string[40];
|
StripStr: string[40];
|
||||||
DynLinkStr : string;
|
DynLinkStr : string;
|
||||||
|
GCSectionsStr : string;
|
||||||
begin
|
begin
|
||||||
StripStr:='';
|
StripStr:='';
|
||||||
if (cs_link_strip in current_settings.globalswitches) then StripStr:='-s';
|
GCSectionsStr:='';
|
||||||
|
DynLinkStr:='';
|
||||||
|
|
||||||
|
if (cs_link_strip in current_settings.globalswitches) then
|
||||||
|
StripStr:='-s';
|
||||||
|
if rlinkpath<>'' Then
|
||||||
|
DynLinkStr:='--rpath-link '+rlinkpath;
|
||||||
|
if UseVLink then
|
||||||
|
begin
|
||||||
|
if create_smartlink_sections then
|
||||||
|
GCSectionsStr:='-gc-all -sc -sd';
|
||||||
|
end;
|
||||||
|
|
||||||
{ Call linker }
|
{ Call linker }
|
||||||
SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
|
SplitBinCmd(Info.ExeCmd[1],BinStr,CmdStr);
|
||||||
@ -383,11 +405,9 @@ begin
|
|||||||
Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
|
Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
|
||||||
Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
|
Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
|
||||||
Replace(cmdstr,'$STRIP',StripStr);
|
Replace(cmdstr,'$STRIP',StripStr);
|
||||||
if rlinkpath<>'' Then
|
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
||||||
DynLinkStr:='--rpath-link '+rlinkpath
|
|
||||||
else
|
|
||||||
DynLinkStr:='';
|
|
||||||
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
||||||
|
|
||||||
MakeAmigaPPCExe:=DoExec(BinStr,CmdStr,true,false);
|
MakeAmigaPPCExe:=DoExec(BinStr,CmdStr,true,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user