mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 22:14:25 +02:00
+ WebAssembly internal linker: write the export section to the linker map file
This commit is contained in:
parent
847ae42cc1
commit
3a714774ff
@ -5097,6 +5097,8 @@ implementation
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
objsec: TWasmObjSection;
|
objsec: TWasmObjSection;
|
||||||
begin
|
begin
|
||||||
|
if assigned(exemap) then
|
||||||
|
exemap.AddHeader('Export section');
|
||||||
FunctionExportsCount:=0;
|
FunctionExportsCount:=0;
|
||||||
textsec:=FindExeSection('.text');
|
textsec:=FindExeSection('.text');
|
||||||
if not assigned(textsec) then
|
if not assigned(textsec) then
|
||||||
@ -5115,6 +5117,8 @@ implementation
|
|||||||
WriteName(FWasmSections[wsiExport],'memory');
|
WriteName(FWasmSections[wsiExport],'memory');
|
||||||
WriteByte(FWasmSections[wsiExport],$02); { mem }
|
WriteByte(FWasmSections[wsiExport],$02); { mem }
|
||||||
WriteUleb(FWasmSections[wsiExport],0); { memidx = 0 }
|
WriteUleb(FWasmSections[wsiExport],0); { memidx = 0 }
|
||||||
|
if assigned(exemap) then
|
||||||
|
exemap.Add(' Memory[0] -> "memory"');
|
||||||
|
|
||||||
for i:=0 to textsec.ObjSectionList.Count-1 do
|
for i:=0 to textsec.ObjSectionList.Count-1 do
|
||||||
begin
|
begin
|
||||||
@ -5124,6 +5128,8 @@ implementation
|
|||||||
WriteName(FWasmSections[wsiExport],objsec.MainFuncSymbol.LinkingData.ExportName);
|
WriteName(FWasmSections[wsiExport],objsec.MainFuncSymbol.LinkingData.ExportName);
|
||||||
WriteByte(FWasmSections[wsiExport],$00); { func }
|
WriteByte(FWasmSections[wsiExport],$00); { func }
|
||||||
WriteUleb(FWasmSections[wsiExport],objsec.MainFuncSymbol.LinkingData.ExeFunctionIndex); { funcidx }
|
WriteUleb(FWasmSections[wsiExport],objsec.MainFuncSymbol.LinkingData.ExeFunctionIndex); { funcidx }
|
||||||
|
if assigned(exemap) then
|
||||||
|
exemap.Add(' Function['+tostr(objsec.MainFuncSymbol.LinkingData.ExeFunctionIndex)+'] -> "'+objsec.MainFuncSymbol.LinkingData.ExportName+'"');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user