+ support writing of 32-bit and 64-bit relocations in the REL object writer

for Z80. This fixes DWARF debug output and makes it behave consistently with
  the Z80 external assembler writer.
This commit is contained in:
Nikolay Nikolov 2022-07-12 19:16:23 +03:00
parent d9e156e90e
commit cf5feb0dca

View File

@ -334,7 +334,7 @@ implementation
procedure TRelObjData.writeReloc(Data: TRelocDataInt; len: aword; p: TObjSymbol; Reloctype: TObjRelocationType);
var
bytes: array [0..1] of Byte;
bytes: array [0..7] of Byte;
symaddr: QWord;
objreloc: TRelRelocation;
begin
@ -373,6 +373,26 @@ implementation
end;
end;
case len of
8:
begin
bytes[0]:=Byte(Data);
bytes[1]:=Byte(Data shr 8);
bytes[2]:=Byte(Data shr 16);
bytes[3]:=Byte(Data shr 24);
bytes[4]:=0;
bytes[5]:=0;
bytes[6]:=0;
bytes[7]:=0;
writebytes(bytes,8);
end;
4:
begin
bytes[0]:=Byte(Data);
bytes[1]:=Byte(Data shr 8);
bytes[2]:=Byte(Data shr 16);
bytes[3]:=Byte(Data shr 24);
writebytes(bytes,4);
end;
2:
begin
bytes[0]:=Byte(Data);