瀏覽代碼

* symbols called by g_call might need to be imported from dynamic packages as well

git-svn-id: trunk@43538 -
svenbarth 5 年之前
父節點
當前提交
6f584333e5
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      compiler/cgobj.pas

+ 4 - 2
compiler/cgobj.pas

@@ -578,8 +578,8 @@ unit cgobj;
 implementation
 implementation
 
 
     uses
     uses
-       globals,systems,
-       verbose,paramgr,symsym,
+       globals,systems,fmodule,
+       verbose,paramgr,symsym,symtable,
        tgobj,cutils,procinfo;
        tgobj,cutils,procinfo;
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -2817,6 +2817,8 @@ implementation
     procedure tcg.g_call(list: TAsmList;const s: string);
     procedure tcg.g_call(list: TAsmList;const s: string);
       begin
       begin
         allocallcpuregisters(list);
         allocallcpuregisters(list);
+        if systemunit<>current_module.globalsymtable then
+          current_module.add_extern_asmsym(s,AB_EXTERNAL,AT_FUNCTION);
         a_call_name(list,s,false);
         a_call_name(list,s,false);
         deallocallcpuregisters(list);
         deallocallcpuregisters(list);
       end;
       end;