Browse Source

* check also procedure aliases for duplicate names when
generating an export stub

git-svn-id: trunk@5993 -

peter 18 years ago
parent
commit
c9703d43d5
2 changed files with 23 additions and 4 deletions
  1. 21 2
      compiler/ncgutil.pas
  2. 2 2
      compiler/systems/t_linux.pas

+ 21 - 2
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

+ 2 - 2
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));