Browse Source

+ create relocation objects for R_WASM_TABLE_INDEX_I32 relocations in the wasm object reader

Nikolay Nikolov 1 year ago
parent
commit
118e093c97
1 changed files with 12 additions and 0 deletions
  1. 12 0
      compiler/ogwasm.pas

+ 12 - 0
compiler/ogwasm.pas

@@ -3837,6 +3837,18 @@ implementation
                       else
                         Writeln('Warning! No object symbol created for ', SymbolTable[RelocIndex].SymName);
                     end;
+                  R_WASM_TABLE_INDEX_I32:
+                    begin
+                      if RelocIndex>high(SymbolTable) then
+                        begin
+                          InputError('Symbol index in relocation too high');
+                          exit;
+                        end;
+                      if Assigned(SymbolTable[RelocIndex].ObjSym) then
+                        ObjSec.ObjRelocations.Add(TWasmObjRelocation.CreateSymbol(RelocOffset-BaseSectionOffset,SymbolTable[RelocIndex].ObjSym,RELOC_ABSOLUTE))
+                      else
+                        Writeln('Warning! No object symbol created for ', SymbolTable[RelocIndex].SymName);
+                    end;
                 end;
               end;