瀏覽代碼

+ WebAssembly internal linker: write the contents of the memory section to the linker map file

Nikolay Nikolov 10 月之前
父節點
當前提交
847ae42cc1
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      compiler/ogwasm.pas

+ 6 - 0
compiler/ogwasm.pas

@@ -5212,17 +5212,23 @@ implementation
 
         if not (ts_wasm_threads in current_settings.targetswitches) then
           begin
+            if assigned(exemap) then
+              exemap.AddHeader('Memory section');
             WriteUleb(FWasmSections[wsiMemory],1);
             if FMaxMemoryPages>=FMinMemoryPages then
               begin
                 WriteByte(FWasmSections[wsiMemory],1);
                 WriteUleb(FWasmSections[wsiMemory],FMinMemoryPages);
                 WriteUleb(FWasmSections[wsiMemory],FMaxMemoryPages);
+                if assigned(exemap) then
+                  exemap.Add('  Memory[0] pages: initial='+tostr(FMinMemoryPages)+' max='+tostr(FMaxMemoryPages));
               end
             else
               begin
                 WriteByte(FWasmSections[wsiMemory],0);
                 WriteUleb(FWasmSections[wsiMemory],FMinMemoryPages);
+                if assigned(exemap) then
+                  exemap.Add('  Memory[0] pages: initial='+tostr(FMinMemoryPages));
               end;
           end;