Browse Source

+ added and implemented TWasmExeOutput.WriteWasmSection

Nikolay Nikolov 1 year ago
parent
commit
7d6158d5f4
1 changed files with 11 additions and 0 deletions
  1. 11 0
      compiler/ogwasm.pas

+ 11 - 0
compiler/ogwasm.pas

@@ -231,6 +231,7 @@ interface
         end;
 
         FWasmSections: array [TWasmSectionID] of tdynamicarray;
+        procedure WriteWasmSection(wsid: TWasmSectionID);
       protected
         function writeData:boolean;override;
         procedure DoRelocationFixup(objsec:TObjSection);override;
@@ -4032,6 +4033,16 @@ implementation
                                TWasmExeOutput
 ****************************************************************************}
 
+    procedure TWasmExeOutput.WriteWasmSection(wsid: TWasmSectionID);
+      var
+        b: byte;
+      begin
+        b:=ord(wsid);
+        Writer.write(b,1);
+        WriteUleb(Writer,FWasmSections[wsid].size);
+        Writer.writearray(FWasmSections[wsid]);
+      end;
+
     function TWasmExeOutput.writeData: boolean;
       begin
         result:=false;