mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 20:29:16 +02:00
+ PS1: allow creating a linker map file with the -Xm option
This commit is contained in:
parent
c24cae29d6
commit
0c7aa1805d
@ -60,7 +60,7 @@ end;
|
|||||||
|
|
||||||
procedure TLinkerPS1.SetDefaultInfo;
|
procedure TLinkerPS1.SetDefaultInfo;
|
||||||
begin
|
begin
|
||||||
info.ExeCmd[1]:= 'ld $OPT $RES';
|
info.ExeCmd[1]:= 'ld $OPT $MAP $RES';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -348,9 +348,13 @@ end;
|
|||||||
|
|
||||||
function TLinkerPS1.MakeExecutable: boolean;
|
function TLinkerPS1.MakeExecutable: boolean;
|
||||||
var
|
var
|
||||||
binstr, cmdstr : TCmdStr;
|
binstr, cmdstr, mapstr : TCmdStr;
|
||||||
success : boolean;
|
success : boolean;
|
||||||
begin
|
begin
|
||||||
|
if (cs_link_map in current_settings.globalswitches) then
|
||||||
|
mapstr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename,'.map'))
|
||||||
|
else
|
||||||
|
mapstr:='';
|
||||||
|
|
||||||
WriteScriptFile;
|
WriteScriptFile;
|
||||||
|
|
||||||
@ -364,6 +368,7 @@ begin
|
|||||||
|
|
||||||
Replace(cmdstr, '$OPT', Info.ExtraOptions);
|
Replace(cmdstr, '$OPT', Info.ExtraOptions);
|
||||||
Replace(cmdstr, '$RES', '-T ' + (maybequoted(ScriptFixFileName(outputexedir + Info.ResName))));
|
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';
|
if cs_link_smart in current_settings.globalswitches then cmdstr:= cmdstr + ' --gc-sections';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user