Browse Source

* fixed bug in the application of RELOC_GLOBAL_INDEX_LEB fixups in the wasm internal exe writer

Nikolay Nikolov 1 year ago
parent
commit
eaf9a9f1b9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/ogwasm.pas

+ 1 - 1
compiler/ogwasm.pas

@@ -4596,7 +4596,7 @@ implementation
                       if objsym.typ<>AT_WASM_GLOBAL then
                         internalerror(2024010111);
                       objsec.Data.seek(objreloc.DataOffset);
-                      WriteUleb5(objsec.Data,UInt32(objsym.offset));
+                      WriteUleb5(objsec.Data,UInt32(objsym.offset+objsym.objsection.MemPos));
                     end;
                   else
                     Writeln('Symbol relocation not yet implemented! ', objreloc.typ);