Browse Source

* don't write R_WASM_TABLE_INDEX_I32 relocations, always use R_WASM_FUNCTION_OFFSET_I32 in debug sections

Nikolay Nikolov 3 years ago
parent
commit
fcadc80163
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/ogwasm.pas

+ 1 - 1
compiler/ogwasm.pas

@@ -1288,7 +1288,7 @@ implementation
                             WriteUleb(relout,TWasmObjSection(objrel.objsection).SegSymIdx);
                             WriteUleb(relout,TWasmObjSection(objrel.objsection).SegSymIdx);
                           WriteSleb(relout,objrel.Addend);  { addend to add to the address }
                           WriteSleb(relout,objrel.Addend);  { addend to add to the address }
                         end
                         end
-                      else if IsExternalFunction(objrel.symbol) or (objrel.symbol.typ=AT_FUNCTION) then
+                      else if (IsExternalFunction(objrel.symbol) or (objrel.symbol.typ=AT_FUNCTION)) and not objsec.IsDebug then
                         begin
                         begin
                           Inc(relcount^);
                           Inc(relcount^);
                           WriteByte(relout,Ord(R_WASM_TABLE_INDEX_I32));
                           WriteByte(relout,Ord(R_WASM_TABLE_INDEX_I32));