]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (output_pic_addr_const): Stubify optimized symbols.
authorMike Stump <mrs@apple.com>
Sat, 24 Feb 2007 22:27:26 +0000 (22:27 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Sat, 24 Feb 2007 22:27:26 +0000 (22:27 +0000)
* config/i386/i386.c (output_pic_addr_const): Stubify optimized
symbols.

From-SVN: r122297

gcc/ChangeLog
gcc/config/i386/i386.c

index 2368d6a0155cb7b49f712265c231848c719fe441..e05b854f5a5019bfea8e2e7e8c16de4a76916b2a 100644 (file)
@@ -1,3 +1,8 @@
+2007-02-24  Mike Stump  <mrs@apple.com>
+
+       * config/i386/i386.c (output_pic_addr_const): Stubify optimized
+       symbols.
+
 2007-02-24  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/30951
index a88c6152a14c38912bd1cb0811166da9370ea310..77382cf4f24efb7dc053a0dc1ac933d297668bef 100644 (file)
@@ -7582,7 +7582,24 @@ output_pic_addr_const (FILE *file, rtx x, int code)
       break;
 
     case SYMBOL_REF:
-      output_addr_const (file, x);
+      if (! TARGET_MACHO || TARGET_64BIT)
+       output_addr_const (file, x);
+      else
+       {
+         const char *name = XSTR (x, 0);
+
+         /* Mark the decl as referenced so that cgraph will output the function.  */
+         if (SYMBOL_REF_DECL (x))
+           mark_decl_referenced (SYMBOL_REF_DECL (x));
+
+         if (MACHOPIC_INDIRECT
+#if TARGET_MACHO
+             && machopic_classify_symbol (x) == MACHOPIC_UNDEFINED_FUNCTION
+#endif
+             )
+           name = machopic_indirection_name (x, /*stub_p=*/true);
+         assemble_name (file, name);
+       }
       if (!TARGET_MACHO && code == 'P' && ! SYMBOL_REF_LOCAL_P (x))
        fputs ("@PLT", file);
       break;