mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 23:28:28 +02:00
+ wasm resource writer: implemented AddEmptySections
This commit is contained in:
parent
729840ca6f
commit
0e0c98f564
@ -65,6 +65,7 @@ type
|
||||
procedure WriteResStringTable;
|
||||
procedure WriteRawData;
|
||||
procedure WriteResData(aStream : TStream; aNode : TResourceTreeNode);
|
||||
procedure AddEmptySections(aResources : TResources);
|
||||
procedure WriteWasmSection(aStream: TStream; wsid: TWasmSectionID);
|
||||
procedure WriteWasmSectionIfNotEmpty(aStream: TStream; wsid: TWasmSectionID);
|
||||
procedure WriteWasmCustomSection(aStream: TStream; wcst: TWasmCustomSectionType);
|
||||
@ -357,6 +358,14 @@ begin
|
||||
WriteResData(aStream,aNode.IDEntries[i]);
|
||||
end;
|
||||
|
||||
procedure TWasmResourceWriter.AddEmptySections(aResources: TResources);
|
||||
begin
|
||||
Align(fDataAlignment,FDataSegments[wrdsResources]);
|
||||
//fSections.Add(HandlesSectName,SHT_NOBITS,SHF_ALLOC or SHF_WRITE,
|
||||
// aStream.Position,fDataAlignment*aResources.Count,fDataAlignment);
|
||||
FDataSegments[wrdsResHandles].SetSize(fDataAlignment*aResources.Count);
|
||||
end;
|
||||
|
||||
procedure TWasmResourceWriter.WriteWasmSection(aStream: TStream;
|
||||
wsid: TWasmSectionID);
|
||||
var
|
||||
@ -476,6 +485,7 @@ begin
|
||||
WriteNodeInfos;
|
||||
WriteResStringTable;
|
||||
WriteRawData;
|
||||
AddEmptySections(aResources);
|
||||
|
||||
WriteImportSection;
|
||||
WriteDataSegments;
|
||||
|
Loading…
Reference in New Issue
Block a user