mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 09:09:42 +02:00
+ add relocation objects for the RELOC_FUNCTION_INDEX_LEB relocation to
the relocation list. They are not written to the object file, yet.
This commit is contained in:
parent
a5d1ce26a0
commit
12496a638b
@ -40,6 +40,11 @@ interface
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
{ TWasmObjRelocation }
|
||||||
|
|
||||||
|
TWasmObjRelocation = class(TObjRelocation)
|
||||||
|
end;
|
||||||
|
|
||||||
{ TWasmObjSymbolExtraData }
|
{ TWasmObjSymbolExtraData }
|
||||||
|
|
||||||
TWasmObjSymbolExtraData = class(TFPHashObject)
|
TWasmObjSymbolExtraData = class(TFPHashObject)
|
||||||
@ -330,7 +335,12 @@ implementation
|
|||||||
p: TObjSymbol; Reloctype: TObjRelocationType);
|
p: TObjSymbol; Reloctype: TObjRelocationType);
|
||||||
const
|
const
|
||||||
leb_zero: array[0..4] of byte=($80,$80,$80,$80,$00);
|
leb_zero: array[0..4] of byte=($80,$80,$80,$80,$00);
|
||||||
|
var
|
||||||
|
objreloc: TWasmObjRelocation;
|
||||||
begin
|
begin
|
||||||
|
if CurrObjSec=nil then
|
||||||
|
internalerror(200403072);
|
||||||
|
objreloc:=nil;
|
||||||
case Reloctype of
|
case Reloctype of
|
||||||
RELOC_FUNCTION_INDEX_LEB:
|
RELOC_FUNCTION_INDEX_LEB:
|
||||||
begin
|
begin
|
||||||
@ -338,6 +348,12 @@ implementation
|
|||||||
internalerror(2021092502);
|
internalerror(2021092502);
|
||||||
if len<>5 then
|
if len<>5 then
|
||||||
internalerror(2021092503);
|
internalerror(2021092503);
|
||||||
|
if not assigned(p) then
|
||||||
|
internalerror(2021092504);
|
||||||
|
if p.bind<>AB_EXTERNAL then
|
||||||
|
internalerror(2021092505);
|
||||||
|
objreloc:=TWasmObjRelocation.CreateSymbol(CurrObjSec.Size,p,Reloctype);
|
||||||
|
CurrObjSec.ObjRelocations.Add(objreloc);
|
||||||
writebytes(leb_zero,5);
|
writebytes(leb_zero,5);
|
||||||
end;
|
end;
|
||||||
RELOC_ABSOLUTE:
|
RELOC_ABSOLUTE:
|
||||||
|
Loading…
Reference in New Issue
Block a user