Browse Source

+ implemented R_WASM_MEMORY_ADDR_LEB relocations in the wasm internal linker

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

+ 7 - 0
compiler/ogwasm.pas

@@ -4307,6 +4307,13 @@ implementation
                           internalerror(2024010108);
                       end;
                     end;
+                  RELOC_MEMORY_ADDR_LEB:
+                    begin
+                      if objsym.typ<>AT_DATA then
+                        internalerror(2024010109);
+                      objsec.Data.seek(objreloc.DataOffset);
+                      WriteUleb5(objsec.Data,UInt32((objsym.offset+objsym.objsection.MemPos)+objreloc.Addend));
+                    end;
                   else
                     Writeln('Symbol relocation not yet implemented! ', objreloc.typ);
                 end;