rs6000.c (symbol_ref_operand): Reject symbols who are not local for Darwin PIC.
authorAndrew Pinski <pinskia@physics.uc.edu>
Mon, 22 Mar 2004 15:04:27 +0000 (15:04 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 22 Mar 2004 15:04:27 +0000 (07:04 -0800)
2004-03-22  Andrew Pinski  <pinskia@physics.uc.edu>

        * config/rs6000/rs6000.c (symbol_ref_operand): Reject symbols
        who are not local for Darwin PIC.

From-SVN: r79830

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index ede0742be4f0c9fbe3caf91665eacad1e771a82c..d37485098b34a9115c0e5a97bfcadd2c4516bce3 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-22  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * config/rs6000/rs6000.c (symbol_ref_operand): Reject symbols
+       who are not local for Darwin PIC.
+
 2004-03-22  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * regrename.c (regrename_optimize): Set regs_ever_live for all
index e046aa4dd071b71e492f44abe6f2c24d43a4e817..8fa0ae6ab0350ce19512a3390a591e7402b91722 100644 (file)
@@ -2260,6 +2260,23 @@ symbol_ref_operand (rtx op, enum machine_mode mode)
   if (mode != VOIDmode && GET_MODE (op) != mode)
     return 0;
 
+#if TARGET_MACHO
+  if (GET_CODE (op) == SYMBOL_REF && TARGET_MACHO && MACHOPIC_INDIRECT)
+    {
+      /* Macho says it has to go through a stub or be local 
+         when indirect mode.  Stubs are considered local.  */
+      const char *t = XSTR (op, 0);
+      /* "&" means that it is it a local defined symbol
+          so it is okay to call to.  */
+      if (t[0] == '&')
+        return true;
+     
+      /* "!T" means that the function is local defined.  */ 
+      return (t[0] == '!' && t[1] == 'T');
+    }
+#endif
+
+
   return (GET_CODE (op) == SYMBOL_REF
          && (DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op)));
 }