* 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]; StripStr: string[40];
DynLinkStr : string; DynLinkStr : string;
GCSectionsStr : string; GCSectionsStr : string;
MapStr: string;
begin begin
StripStr:=''; StripStr:='';
GCSectionsStr:=''; GCSectionsStr:='';
DynLinkStr:=''; 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 if (cs_link_strip in current_settings.globalswitches) then
StripStr:='-s'; StripStr:='-s';
if rlinkpath<>'' Then if rlinkpath<>'' Then
@ -406,6 +410,7 @@ begin
Replace(cmdstr,'$OPT',Info.ExtraOptions); Replace(cmdstr,'$OPT',Info.ExtraOptions);
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,'$MAP',MapStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr); Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
Replace(cmdstr,'$DYNLINK',DynLinkStr); Replace(cmdstr,'$DYNLINK',DynLinkStr);

View File

@ -73,7 +73,7 @@ begin
end end
else else
begin 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; end;
end; end;
@ -215,13 +215,17 @@ var
DynLinkStr : string; DynLinkStr : string;
GCSectionsStr : string; GCSectionsStr : string;
FlagsStr : string; FlagsStr : string;
MapStr: string;
ExeName: string; ExeName: string;
begin begin
StripStr:=''; StripStr:='';
GCSectionsStr:=''; GCSectionsStr:='';
DynLinkStr:=''; DynLinkStr:='';
MapStr:='';
FlagsStr:='-tos-flags fastload,fastram'; 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 if (cs_link_strip in current_settings.globalswitches) then
StripStr:='-s'; StripStr:='-s';
if rlinkpath<>'' then if rlinkpath<>'' then
@ -242,6 +246,7 @@ begin
Replace(cmdstr,'$OPT',Info.ExtraOptions); Replace(cmdstr,'$OPT',Info.ExtraOptions);
Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ExeName))); Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ExeName)));
Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName))); Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
Replace(cmdstr,'$MAP',MapStr);
Replace(cmdstr,'$FLAGS',FlagsStr); Replace(cmdstr,'$FLAGS',FlagsStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr); Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);

View File

@ -210,7 +210,7 @@ procedure TLinkerZXSpectrum.SetDefaultInfo_Vlink;
FOrigin:=DefaultOrigin; FOrigin:=DefaultOrigin;
with Info do with Info do
begin 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;
end; end;
@ -280,13 +280,18 @@ function TLinkerZXSpectrum.MakeExecutable_Vlink: boolean;
GCSectionsStr, GCSectionsStr,
StripStr, StripStr,
StartSymbolStr, StartSymbolStr,
MapStr,
FixedExeFilename: string; FixedExeFilename: string;
begin begin
GCSectionsStr:='-gc-all -mtype'; GCSectionsStr:='-gc-all -mtype';
StripStr:=''; StripStr:='';
MapStr:='';
StartSymbolStr:='start'; StartSymbolStr:='start';
FixedExeFileName:=maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.ihx'))); 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 } { Write used files and libraries }
WriteResponseFile_Vlink(); WriteResponseFile_Vlink();
@ -296,6 +301,7 @@ function TLinkerZXSpectrum.MakeExecutable_Vlink: boolean;
Replace(cmdstr,'$EXE',FixedExeFileName); Replace(cmdstr,'$EXE',FixedExeFileName);
Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName)))); Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
Replace(cmdstr,'$MAP',MapStr);
Replace(cmdstr,'$STRIP',StripStr); Replace(cmdstr,'$STRIP',StripStr);
Replace(cmdstr,'$STARTSYMBOL',StartSymbolStr); Replace(cmdstr,'$STARTSYMBOL',StartSymbolStr);
Replace(cmdstr,'$GCSECTIONS',GCSectionsStr); Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);