Browse Source

expunix.pas, texportlibunix:
* generatelib: check all procdefs whether they have the alias and not only the first one

git-svn-id: branches/svenbarth/packages@32458 -

svenbarth 9 years ago
parent
commit
d9983f2d35
1 changed files with 13 additions and 2 deletions
  1. 13 2
      compiler/expunix.pas

+ 13 - 2
compiler/expunix.pas

@@ -131,6 +131,8 @@ procedure texportlibunix.generatelib;  // straight t_linux copy for now.
 var
 var
   hp2 : texported_item;
   hp2 : texported_item;
   pd  : tprocdef;
   pd  : tprocdef;
+  anyhasalias : boolean;
+  i : longint;
 {$ifdef x86}
 {$ifdef x86}
   sym : tasmsymbol;
   sym : tasmsymbol;
   r : treference;
   r : treference;
@@ -147,8 +149,17 @@ begin
       begin
       begin
         { the manglednames can already be the same when the procedure
         { the manglednames can already be the same when the procedure
           is declared with cdecl }
           is declared with cdecl }
-        pd:=tprocdef(tprocsym(hp2.sym).ProcdefList[0]);
-        if not has_alias_name(pd,hp2.name^) then
+        { note: for "exports" sections we only allow non overloaded procsyms,
+                so checking all symbols only matters for packages }
+        anyhasalias:=false;
+        for i:=0 to tprocsym(hp2.sym).procdeflist.count-1 do
+          begin
+            pd:=tprocdef(tprocsym(hp2.sym).procdeflist[i]);
+            anyhasalias:=has_alias_name(pd,hp2.name^);
+            if anyhasalias then
+              break;
+          end;
+        if not anyhasalias then
          begin
          begin
            { place jump in al_procedures }
            { place jump in al_procedures }
            current_asmdata.asmlists[al_procedures].concat(tai_align.create(target_info.alignment.procalign));
            current_asmdata.asmlists[al_procedures].concat(tai_align.create(target_info.alignment.procalign));