Explorar el Código

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

Nikolay Nikolov hace 1 año
padre
commit
bd606c6b77
Se han modificado 1 ficheros con 16 adiciones y 0 borrados
  1. 16 0
      compiler/ogwasm.pas

+ 16 - 0
compiler/ogwasm.pas

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