Browse Source

* fixed calling of external procedures if the first time they are used in a
compilation unit is in an expression which merely takes their address

git-svn-id: trunk@439 -

Jonas Maebe 20 years ago
parent
commit
7356f83713
1 changed files with 6 additions and 3 deletions
  1. 6 3
      compiler/powerpc/cgcpu.pas

+ 6 - 3
compiler/powerpc/cgcpu.pas

@@ -352,12 +352,15 @@ const
         l1: tasmsymbol;
         l1: tasmsymbol;
       begin
       begin
         { function declared in the current unit? }
         { function declared in the current unit? }
-        result := objectlibrary.getasmsymbol(s);
+        { doesn't work correctly, because this will also return a hit if we }
+        { previously took the address of an external procedure. It doesn't  }
+        { really matter, the linker will remove all unnecessary stubs.      }
+{        result := objectlibrary.getasmsymbol(s);
         if not(assigned(result)) then
         if not(assigned(result)) then
-          begin
+          begin }
             stubname := 'L'+s+'$stub';
             stubname := 'L'+s+'$stub';
             result := objectlibrary.getasmsymbol(stubname);
             result := objectlibrary.getasmsymbol(stubname);
-          end;
+{          end; }
         if assigned(result) then
         if assigned(result) then
           exit;
           exit;