+ read the section content in the wasm object reader

This commit is contained in:
Nikolay Nikolov 2023-12-26 20:38:58 +02:00
parent 56fe6cadc8
commit 23fa8c80b6

View File

@ -3016,6 +3016,7 @@ implementation
ModuleMagic: array [0..3] of Byte;
ModuleVersion: array [0..3] of Byte;
i: Integer;
CurrSec: TObjSection;
begin
FReader:=AReader;
InputFileName:=AReader.FileName;
@ -3034,6 +3035,18 @@ implementation
while AReader.Pos<AReader.size do
if not ReadSection then
exit;
for i:=low(DataSegments) to high(DataSegments) do
with DataSegments[i] do
if Active then
begin
CurrSec:=ObjData.createsection(SegName,1 shl SegAlignment,[oso_Data,oso_load,oso_write],false);
CurrSec.DataPos:=DataPos;
CurrSec.MemPos:=Offset;
CurrSec.Size:=Len;
end;
ReadSectionContent(ObjData);
Result:=True;
end;