+ set the program origin (i.e. the load address) and pass it to the linker for the ZX Spectrum target

git-svn-id: branches/z80@44853 -
This commit is contained in:
nickysn 2020-04-19 15:02:22 +00:00
parent 21dd92df23
commit 4b32780516

View File

@ -41,6 +41,7 @@ implementation
TLinkerZXSpectrum_SdccSdld=class(texternallinker)
private
FOrigin: Word;
Function WriteResponseFile: Boolean;
public
{ constructor Create; override;}
@ -215,9 +216,10 @@ procedure TLinkerZXSpectrum_SdccSdld.SetDefaultInfo;
ExeName='sdcc-sdld';
{$endif}
begin
FOrigin:=32768;
with Info do
begin
ExeCmd[1]:=ExeName+' -n $OPT -i $MAP $EXE -f $RES'
ExeCmd[1]:=ExeName+' -n -b _CODE=$ORIGIN $OPT -i $MAP $EXE -f $RES'
//-g '+platform_select+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP $MAP -L. -o $EXE -T $RES';
end;
end;
@ -255,6 +257,7 @@ function TLinkerZXSpectrum_SdccSdld.MakeExecutable: boolean;
{ Call linker }
SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
Replace(cmdstr,'$OPT',Info.ExtraOptions);
Replace(cmdstr,'$ORIGIN',tostr(FOrigin));
if not(cs_link_on_target in current_settings.globalswitches) then
begin
Replace(cmdstr,'$EXE',FixedExeFileName);