+ PS1: allow creating a linker map file with the -Xm option

This commit is contained in:
Nikolay Nikolov 2024-10-04 22:06:07 +03:00
parent c24cae29d6
commit 0c7aa1805d

View File

@ -60,7 +60,7 @@ end;
procedure TLinkerPS1.SetDefaultInfo;
begin
info.ExeCmd[1]:= 'ld $OPT $RES';
info.ExeCmd[1]:= 'ld $OPT $MAP $RES';
end;
@ -348,9 +348,13 @@ end;
function TLinkerPS1.MakeExecutable: boolean;
var
binstr, cmdstr : TCmdStr;
binstr, cmdstr, mapstr : TCmdStr;
success : boolean;
begin
if (cs_link_map in current_settings.globalswitches) then
mapstr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.map'))
else
mapstr:='';
WriteScriptFile;
@ -364,6 +368,7 @@ begin
Replace(cmdstr, '$OPT', Info.ExtraOptions);
Replace(cmdstr, '$RES', '-T ' + (maybequoted(ScriptFixFileName(outputexedir + Info.ResName))));
Replace(cmdstr, '$MAP', mapstr);
if cs_link_smart in current_settings.globalswitches then cmdstr:= cmdstr + ' --gc-sections';