* backported vlink map file generation to other targets using vlink: Amiga, Atari and ZXSpectrum

git-svn-id: trunk@47560 -
This commit is contained in:
Károly Balogh 2020-11-24 19:07:15 +00:00
parent ffa1b24f7e
commit ab2db33b4c
3 changed files with 18 additions and 2 deletions

View File

@ -385,11 +385,15 @@ var
StripStr: string[40];
DynLinkStr : string;
GCSectionsStr : string;
MapStr: string;
begin
StripStr:='';
GCSectionsStr:='';
DynLinkStr:='';
MapStr:='';
if UseVlink and (cs_link_map in current_settings.globalswitches) then
MapStr:='-M'+Unix2AmigaPath(maybequoted(ScriptFixFilename(current_module.mapfilename)));
if (cs_link_strip in current_settings.globalswitches) then
StripStr:='-s';
if rlinkpath<>'' Then
@ -406,6 +410,7 @@ begin
Replace(cmdstr,'$OPT',Info.ExtraOptions);
Replace(cmdstr,'$EXE',Unix2AmigaPath(maybequoted(ScriptFixFileName(current_module.exefilename))));
Replace(cmdstr,'$RES',Unix2AmigaPath(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
Replace(cmdstr,'$MAP',MapStr);
Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
Replace(cmdstr,'$DYNLINK',DynLinkStr);

View File

@ -73,7 +73,7 @@ begin
end
else
begin
ExeCmd[1]:='vlink -b ataritos $FLAGS $GCSECTIONS $OPT $STRIP -o $EXE -T $RES';
ExeCmd[1]:='vlink -b ataritos $FLAGS $GCSECTIONS $OPT $STRIP $MAP -o $EXE -T $RES';
end;
end;
end;
@ -215,13 +215,17 @@ var
DynLinkStr : string;
GCSectionsStr : string;
FlagsStr : string;
MapStr: string;
ExeName: string;
begin
StripStr:='';
GCSectionsStr:='';
DynLinkStr:='';
MapStr:='';
FlagsStr:='-tos-flags fastload,fastram';
if UseVlink and (cs_link_map in current_settings.globalswitches) then
MapStr:='-M'+maybequoted(ScriptFixFileName(current_module.mapfilename));
if (cs_link_strip in current_settings.globalswitches) then
StripStr:='-s';
if rlinkpath<>'' then
@ -242,6 +246,7 @@ begin
Replace(cmdstr,'$OPT',Info.ExtraOptions);
Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ExeName)));
Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
Replace(cmdstr,'$MAP',MapStr);
Replace(cmdstr,'$FLAGS',FlagsStr);
Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);

View File

@ -210,7 +210,7 @@ procedure TLinkerZXSpectrum.SetDefaultInfo_Vlink;
FOrigin:=DefaultOrigin;
with Info do
begin
ExeCmd[1]:=ExeName+' -bihex $GCSECTIONS -e $STARTSYMBOL $STRIP $OPT -o $EXE -T $RES'
ExeCmd[1]:=ExeName+' -bihex $GCSECTIONS -e $STARTSYMBOL $STRIP $OPT $MAP -o $EXE -T $RES'
end;
end;
@ -280,13 +280,18 @@ function TLinkerZXSpectrum.MakeExecutable_Vlink: boolean;
GCSectionsStr,
StripStr,
StartSymbolStr,
MapStr,
FixedExeFilename: string;
begin
GCSectionsStr:='-gc-all -mtype';
StripStr:='';
MapStr:='';
StartSymbolStr:='start';
FixedExeFileName:=maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.ihx')));
if (cs_link_map in current_settings.globalswitches) then
MapStr:='-M'+maybequoted(ScriptFixFileName(current_module.mapfilename));
{ Write used files and libraries }
WriteResponseFile_Vlink();
@ -296,6 +301,7 @@ function TLinkerZXSpectrum.MakeExecutable_Vlink: boolean;
Replace(cmdstr,'$EXE',FixedExeFileName);
Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
Replace(cmdstr,'$MAP',MapStr);
Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$STARTSYMBOL',StartSymbolStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);