* start the data at offset 1024 instead of 0, just like the LLVM linker

This commit is contained in:
Nikolay Nikolov 2024-01-01 22:38:03 +02:00
parent baa81d5275
commit 5eb5fdabad

View File

@ -4681,9 +4681,11 @@ implementation
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. }
Data lives in a separate address space, so start addressing back from 0
(the LLVM leaves the first 1024 bytes in the data segment empty, so we
start at 1024). }
if aname='.rodata' then
CurrMemPos:=0;
CurrMemPos:=1024;
inherited MemPos_ExeSection(aname);
end;