diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas
index 821690776d..dcc960d624 100644
--- a/compiler/ncgutil.pas
+++ b/compiler/ncgutil.pas
@@ -72,6 +72,7 @@ interface
 
     function  maybe_pushfpu(list:TAsmList;needed : byte;var l:tlocation) : boolean;
 
+    function  has_alias_name(pd:tprocdef;const s:string):boolean;
     procedure alloc_proc_symbol(pd: tprocdef);
     procedure gen_proc_symbol(list:TAsmList);
     procedure gen_proc_symbol_end(list:TAsmList);
@@ -1885,9 +1886,27 @@ implementation
                                 Entry/Exit
 ****************************************************************************}
 
+    function has_alias_name(pd:tprocdef;const s:string):boolean;
+      var
+        item : tstringlistitem;
+      begin
+        result:=true;
+        if pd.mangledname=s then
+          exit;
+        item := tstringlistitem(pd.aliasnames.first);
+        while assigned(item) do
+          begin
+            if item.str=s then
+              exit;
+            item := tstringlistitem(item.next);
+          end;
+        result:=false;
+      end;
+
+
     procedure alloc_proc_symbol(pd: tprocdef);
-     var
-        item: tstringlistitem;
+      var
+        item : tstringlistitem;
       begin
         item := tstringlistitem(pd.aliasnames.first);
         while assigned(item) do
diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas
index bfcea7f1e8..4df4afce1a 100644
--- a/compiler/systems/t_linux.pas
+++ b/compiler/systems/t_linux.pas
@@ -71,7 +71,7 @@ implementation
     symconst,script,
     fmodule,
     aasmbase,aasmtai,aasmdata,aasmcpu,cpubase,
-    cgbase,cgobj,cgutils,ogbase,
+    cgbase,cgobj,cgutils,ogbase,ncgutil,
     i_linux
     ;
 
@@ -164,7 +164,7 @@ begin
         { the manglednames can already be the same when the procedure
           is declared with cdecl }
         pd:=tprocdef(tprocsym(hp2.sym).ProcdefList[0]);
-        if pd.mangledname<>hp2.name^ then
+        if has_alias_name(pd,hp2.name^) then
          begin
            { place jump in al_procedures }
            current_asmdata.asmlists[al_procedures].concat(tai_align.create(target_info.alignment.procalign));