diff --git a/packages/fcl-res/src/wasmwriter.pp b/packages/fcl-res/src/wasmwriter.pp index 2f853d3040..fb2b366660 100644 --- a/packages/fcl-res/src/wasmwriter.pp +++ b/packages/fcl-res/src/wasmwriter.pp @@ -45,6 +45,7 @@ type fDataCurOfs : longword; FWasmSections: array [TWasmSectionID] of TMemoryStream; FDataSegments: array [TWasmResourceDataSegment] of TMemoryStream; + FDataSegmentFileSectionOfs: array [TWasmResourceDataSegment] of Int64; FDataRelocations: array of TWasmRelocationEntry; FWasmCustomSections: array [TWasmCustomSectionType] of TMemoryStream; FWasmLinkingSubsections: array [low(TWasmLinkingSubsectionType)..high(TWasmLinkingSubsectionType)] of TMemoryStream; @@ -180,14 +181,19 @@ end; procedure TWasmResourceWriter.WriteRelocationDataTable(DataSectionIndex: Integer); var i: Integer; + s: TWasmResourceDataSegment; begin WriteUleb(FWasmCustomSections[wcstRelocData],DataSectionIndex); WriteUleb(FWasmCustomSections[wcstRelocData],Length(FDataRelocations)); for i:=0 to Length(FDataRelocations)-1 do with FDataRelocations[i] do begin + if Offset0 then begin FWasmSections[wsiData].CopyFrom(FDataSegments[ds], 0);