瀏覽代碼

* only set MainFuncSymbol of code sections to the main (non-alias) symbol

Nikolay Nikolov 1 年之前
父節點
當前提交
cf79ca16b4
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/ogwasm.pas

+ 2 - 1
compiler/ogwasm.pas

@@ -3879,7 +3879,8 @@ implementation
                       objsym.bind:=AB_GLOBAL;
                       objsym.bind:=AB_GLOBAL;
                       objsym.typ:=AT_FUNCTION;
                       objsym.typ:=AT_FUNCTION;
                       objsym.objsection:=TObjSection(ObjData.ObjSectionList[SymIndex-FuncTypeImportsCount]);
                       objsym.objsection:=TObjSection(ObjData.ObjSectionList[SymIndex-FuncTypeImportsCount]);
-                      TWasmObjSection(ObjData.ObjSectionList[SymIndex-FuncTypeImportsCount]).MainFuncSymbol:=objsym;
+                      if (SymFlags and WASM_SYM_EXPLICIT_NAME)=0 then
+                        TWasmObjSection(ObjData.ObjSectionList[SymIndex-FuncTypeImportsCount]).MainFuncSymbol:=objsym;
                       objsym.offset:=0;
                       objsym.offset:=0;
                       objsym.size:=objsym.objsection.Size;
                       objsym.size:=objsym.objsection.Size;
                     end;
                     end;