|
@@ -30,6 +30,7 @@ interface
|
|
implementation
|
|
implementation
|
|
|
|
|
|
uses
|
|
uses
|
|
|
|
+ aasmbase,
|
|
SysUtils,
|
|
SysUtils,
|
|
cutils,cfileutl,cclasses,
|
|
cutils,cfileutl,cclasses,
|
|
globtype,globals,systems,verbose,script,fmodule,i_gba,link;
|
|
globtype,globals,systems,verbose,script,fmodule,i_gba,link;
|
|
@@ -554,14 +555,22 @@ var
|
|
StaticStr,
|
|
StaticStr,
|
|
GCSectionsStr,
|
|
GCSectionsStr,
|
|
DynLinkStr,
|
|
DynLinkStr,
|
|
|
|
+ MapStr,
|
|
StripStr: string;
|
|
StripStr: string;
|
|
begin
|
|
begin
|
|
{ for future use }
|
|
{ for future use }
|
|
StaticStr:='';
|
|
StaticStr:='';
|
|
StripStr:='';
|
|
StripStr:='';
|
|
DynLinkStr:='';
|
|
DynLinkStr:='';
|
|
-
|
|
|
|
- GCSectionsStr:='--gc-sections';
|
|
|
|
|
|
+ MapStr:='';
|
|
|
|
+
|
|
|
|
+ if (cs_link_strip in current_settings.globalswitches) and
|
|
|
|
+ not(cs_link_separate_dbg_file in current_settings.globalswitches) then
|
|
|
|
+ StripStr:='-s';
|
|
|
|
+ if (cs_link_map in current_settings.globalswitches) then
|
|
|
|
+ StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
|
|
|
|
+ if create_smartlink_sections then
|
|
|
|
+ GCSectionsStr:='--gc-sections';
|
|
//if not(cs_link_extern in current_settings.globalswitches) then
|
|
//if not(cs_link_extern in current_settings.globalswitches) then
|
|
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.exefilename^);
|
|
Message1(exec_i_linking,current_module.exefilename^);
|
|
@@ -572,24 +581,15 @@ begin
|
|
{ Call linker }
|
|
{ Call linker }
|
|
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
|
|
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
|
|
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
|
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
|
- if not(cs_link_on_target in current_settings.globalswitches) then
|
|
|
|
- begin
|
|
|
|
- Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf')))));
|
|
|
|
- Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
|
|
|
|
- Replace(cmdstr,'$STATIC',StaticStr);
|
|
|
|
- Replace(cmdstr,'$STRIP',StripStr);
|
|
|
|
- Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
|
|
|
- Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
|
|
|
- end
|
|
|
|
- else
|
|
|
|
- begin
|
|
|
|
- Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf'))));
|
|
|
|
- Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
|
|
|
|
- Replace(cmdstr,'$STATIC',StaticStr);
|
|
|
|
- Replace(cmdstr,'$STRIP',StripStr);
|
|
|
|
- Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
|
|
|
- Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
|
|
|
- end;
|
|
|
|
|
|
+
|
|
|
|
+ Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf')))));
|
|
|
|
+ Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
|
|
|
|
+ Replace(cmdstr,'$STATIC',StaticStr);
|
|
|
|
+ Replace(cmdstr,'$STRIP',StripStr);
|
|
|
|
+ Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
|
|
|
|
+ Replace(cmdstr,'$MAP',MapStr);
|
|
|
|
+ Replace(cmdstr,'$DYNLINK',DynLinkStr);
|
|
|
|
+
|
|
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
|
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
|
|
|
|
|
{ Remove ReponseFile }
|
|
{ Remove ReponseFile }
|