|
@@ -248,6 +248,7 @@ interface
|
|
|
destructor destroy;override;
|
|
|
procedure GenerateLibraryImports(ImportLibraryList:TFPHashObjectList);override;
|
|
|
procedure AfterUnusedSectionRemoval;override;
|
|
|
+ procedure MemPos_ExeSection(const aname:string);override;
|
|
|
end;
|
|
|
|
|
|
{ TWasmAssembler }
|
|
@@ -4252,6 +4253,15 @@ implementation
|
|
|
PrepareFunctions;
|
|
|
end;
|
|
|
|
|
|
+ procedure TWasmExeOutput.MemPos_ExeSection(const aname: string);
|
|
|
+ begin
|
|
|
+ { WebAssembly is a Harvard architecture.
|
|
|
+ Data lives in a separate address space, so start addressing back from 0. }
|
|
|
+ if aname='.data' then
|
|
|
+ CurrMemPos:=0;
|
|
|
+ inherited MemPos_ExeSection(aname);
|
|
|
+ end;
|
|
|
+
|
|
|
procedure TWasmExeOutput.PrepareImports;
|
|
|
|
|
|
function AddFunctionImport(const libname,symname:TCmdStr; functype: TWasmFuncType): Integer;
|