浏览代码

+ support writing R_WASM_MEMORY_ADDR_I32 relocations

Nikolay Nikolov 3 年之前
父节点
当前提交
ea401ccc82
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      compiler/ogwasm.pas

+ 7 - 1
compiler/ogwasm.pas

@@ -1015,7 +1015,13 @@ implementation
                           WriteUleb(relout,TWasmObjSymbol(objrel.symbol).SymbolIndex);
                         end
                       else
-                        internalerror(2021092609);
+                        begin
+                          Inc(relcount^);
+                          WriteByte(relout,Ord(R_WASM_MEMORY_ADDR_I32));
+                          WriteUleb(relout,objrel.DataOffset+objsec.FileSectionOfs);
+                          WriteUleb(relout,TWasmObjSymbol(objrel.symbol).SymbolIndex);
+                          WriteUleb(relout,0);  { addend to add to the address }
+                        end;
                     end;
                   RELOC_TYPE_INDEX_LEB:
                     begin