Browse Source

+ WebAssembly internal linker: added check for relocations increasing section
data's size. The check is behind ifdef EXTDEBUG_WASM, because it slows down
compilation.

Nikolay Nikolov 1 week ago
parent
commit
7cdcf03910
1 changed files with 4 additions and 0 deletions
  1. 4 0
      compiler/ogwasm.pas

+ 4 - 0
compiler/ogwasm.pas

@@ -5520,6 +5520,10 @@ implementation
               end
               end
             else
             else
               internalerror(2024010110);
               internalerror(2024010110);
+{$ifdef EXTDEBUG_WASM}
+            if (FRelocationPass=2) and assigned(objsec.data) and (objsec.data.size<>objsec.size) then
+              internalerror(2025100101,'relocation increased section''s data size: '+objreloc.ToString);
+{$endif}
           end;
           end;
       end;
       end;