mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 12:09:16 +02:00
+ wasm internal linker: fill ExeFunctionIndex of alias code symbols as well
This commit is contained in:
parent
cf79ca16b4
commit
50986967f5
@ -4270,10 +4270,11 @@ implementation
|
|||||||
|
|
||||||
procedure TWasmExeOutput.PrepareFunctions;
|
procedure TWasmExeOutput.PrepareFunctions;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i, j: Integer;
|
||||||
exesec: TExeSection;
|
exesec: TExeSection;
|
||||||
objsec: TWasmObjSection;
|
objsec: TWasmObjSection;
|
||||||
fsym: TWasmObjSymbol;
|
fsym: TWasmObjSymbol;
|
||||||
|
objdata: TObjData;
|
||||||
begin
|
begin
|
||||||
if assigned(exemap) then
|
if assigned(exemap) then
|
||||||
begin
|
begin
|
||||||
@ -4302,6 +4303,21 @@ implementation
|
|||||||
exemap.Add(' Function[' + tostr(fsym.LinkingData.ExeFunctionIndex) + '] ' + fsym.Name + fsym.LinkingData.FuncType.ToString);
|
exemap.Add(' Function[' + tostr(fsym.LinkingData.ExeFunctionIndex) + '] ' + fsym.Name + fsym.LinkingData.FuncType.ToString);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{ set ExeFunctionIndex to the alias symbols as well }
|
||||||
|
for i:=0 to ObjDataList.Count-1 do
|
||||||
|
begin
|
||||||
|
objdata:=TObjData(ObjDataList[i]);
|
||||||
|
for j:=0 to objdata.ObjSymbolList.Count-1 do
|
||||||
|
begin
|
||||||
|
fsym:=TWasmObjSymbol(objdata.ObjSymbolList[j]);
|
||||||
|
if assigned(fsym.objsection) and fsym.objsection.USed and (fsym.typ=AT_FUNCTION) and (fsym.LinkingData.ExeFunctionIndex=-1) then
|
||||||
|
begin
|
||||||
|
fsym.LinkingData.ExeFunctionIndex:=TWasmObjSection(fsym.objsection).MainFuncSymbol.LinkingData.ExeFunctionIndex;
|
||||||
|
if fsym.LinkingData.ExeFunctionIndex=-1 then
|
||||||
|
internalerror(2024010102);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user