From: Mike Stump Date: Sat, 24 Feb 2007 22:27:26 +0000 (+0000) Subject: i386.c (output_pic_addr_const): Stubify optimized symbols. X-Git-Tag: releases/gcc-4.3.0~6617 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=320ce1d3a34ca4aa1c7300b0b8f843a6b1d4167e;p=thirdparty%2Fgcc.git i386.c (output_pic_addr_const): Stubify optimized symbols. * config/i386/i386.c (output_pic_addr_const): Stubify optimized symbols. From-SVN: r122297 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2368d6a0155c..e05b854f5a50 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-02-24 Mike Stump + + * config/i386/i386.c (output_pic_addr_const): Stubify optimized + symbols. + 2007-02-24 Richard Guenther PR middle-end/30951 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a88c6152a14c..77382cf4f24e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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;