* configure.ac (gcc_cv_as_hidden): Enable on *-*-darwin*.
(gcc_cv_ld_hidden): Likewise.
* configure: Regenerate.
* config/i386/i386.c (USE_HIDDEN_LINKONCE): Remove TARGET_MACHO.
(ix86_stack_protect_fail): Mark unused.
(TARGET_STACK_PROTECT_FAIL) [TARGET_MACHO]: Don't redefine.
* config/rs6000/rs6000.c (rs6000_assemble_visibility)
[TARGET_MACHO]: Don't define.
(TARGET_ASM_ASSEMBLE_VISIBILITY): Likewise.
(TARGET_STACK_PROTECT_FAIL): Likewise.
(rs6000_stack_protect_fail): Mark unused.
* dwarf2asm.c (dw2_output_indirect_constant_1): Mark decl hidden if
USE_LINKONCE_INDIRECT.
Don't emit .hidden expicitly.
From-SVN: r174837
+2011-06-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (gcc_cv_as_hidden): Enable on *-*-darwin*.
+ (gcc_cv_ld_hidden): Likewise.
+ * configure: Regenerate.
+ * config/i386/i386.c (USE_HIDDEN_LINKONCE): Remove TARGET_MACHO.
+ (ix86_stack_protect_fail): Mark unused.
+ (TARGET_STACK_PROTECT_FAIL) [TARGET_MACHO]: Don't redefine.
+ * config/rs6000/rs6000.c (rs6000_assemble_visibility)
+ [TARGET_MACHO]: Don't define.
+ (TARGET_ASM_ASSEMBLE_VISIBILITY): Likewise.
+ (TARGET_STACK_PROTECT_FAIL): Likewise.
+ (rs6000_stack_protect_fail): Mark unused.
+ * dwarf2asm.c (dw2_output_indirect_constant_1): Mark decl hidden if
+ USE_LINKONCE_INDIRECT.
+ Don't emit .hidden expicitly.
+
2011-06-08 Andi Kleen <ak@linux.intel.com>
* varasm.c (get_section): Print location of other conflict
}
\f
#ifndef USE_HIDDEN_LINKONCE
-# if (defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)) || TARGET_MACHO
+# if defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)
# define USE_HIDDEN_LINKONCE 1
# else
# define USE_HIDDEN_LINKONCE 0
__stack_chk_fail directly. 64-bit code doesn't need to setup any PIC
register, so it is better to call __stack_chk_fail directly. */
-static tree
+static tree ATTRIBUTE_UNUSED
ix86_stack_protect_fail (void)
{
return TARGET_64BIT
#undef TARGET_MANGLE_TYPE
#define TARGET_MANGLE_TYPE ix86_mangle_type
+#ifndef TARGET_MACHO
#undef TARGET_STACK_PROTECT_FAIL
#define TARGET_STACK_PROTECT_FAIL ix86_stack_protect_fail
+#endif
#undef TARGET_SUPPORTS_SPLIT_STACK
#define TARGET_SUPPORTS_SPLIT_STACK ix86_supports_split_stack
static struct machine_function * rs6000_init_machine_status (void);
static bool rs6000_assemble_integer (rtx, unsigned int, int);
static bool no_global_regs_above (int, bool);
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
static void rs6000_assemble_visibility (tree, int);
#endif
static int rs6000_ra_ever_killed (void);
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER rs6000_assemble_integer
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
#undef TARGET_ASM_ASSEMBLE_VISIBILITY
#define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility
#endif
#define TARGET_DEFAULT_TARGET_FLAGS \
(TARGET_DEFAULT)
+#ifndef TARGET_MACHO
#undef TARGET_STACK_PROTECT_FAIL
#define TARGET_STACK_PROTECT_FAIL rs6000_stack_protect_fail
+#endif
/* MPC604EUM 3.5.2 Weak Consistency between Multiple Processors
The PowerPC architecture requires only weak consistency among
return default_assemble_integer (x, size, aligned_p);
}
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
/* Emit an assembler directive to set symbol visibility for DECL to
VISIBILITY_TYPE. */
calling __stack_chk_fail directly. Otherwise it is better to call
__stack_chk_fail directly. */
-static tree
+static tree ATTRIBUTE_UNUSED
rs6000_stack_protect_fail (void)
{
return (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_hidden" >&5
$as_echo "$gcc_cv_as_hidden" >&6; }
+case "${target}" in
+ *-*-darwin*)
+ # Darwin as has some visibility support, though with a different syntax.
+ gcc_cv_as_hidden=yes
+ ;;
+esac
# gnu_indirect_function type is an extension proposed at
# http://groups.google/com/group/generic-abi/files. It allows dynamic runtime
fi
else
case "${target}" in
+ *-*-darwin*)
+ # Darwin ld has some visibility support.
+ gcc_cv_ld_hidden=yes
+ ;;
hppa64*-*-hpux* | ia64*-*-hpux*)
gcc_cv_ld_hidden=yes
;;
gcc_cv_as_hidden=yes
;;
esac])
+case "${target}" in
+ *-*-darwin*)
+ # Darwin as has some visibility support, though with a different syntax.
+ gcc_cv_as_hidden=yes
+ ;;
+esac
# gnu_indirect_function type is an extension proposed at
# http://groups.google/com/group/generic-abi/files. It allows dynamic runtime
fi
else
case "${target}" in
+ *-*-darwin*)
+ # Darwin ld has some visibility support.
+ gcc_cv_ld_hidden=yes
+ ;;
hppa64*-*-hpux* | ia64*-*-hpux*)
gcc_cv_ld_hidden=yes
;;
/* Dwarf2 assembler output helper routines.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
{
TREE_PUBLIC (decl) = 1;
make_decl_one_only (decl, DECL_ASSEMBLER_NAME (decl));
+ if (USE_LINKONCE_INDIRECT)
+ DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
}
else
TREE_STATIC (decl) = 1;
sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
- sym = targetm.strip_name_encoding (sym);
- if (TREE_PUBLIC (decl) && USE_LINKONCE_INDIRECT)
- fprintf (asm_out_file, "\t.hidden %sDW.ref.%s\n", user_label_prefix, sym);
assemble_variable (decl, 1, 1, 1);
assemble_integer (sym_ref, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);