From 3c267741be087581d72f7d61404b4c8c1b7de738 Mon Sep 17 00:00:00 2001 From: "ro@138bc75d-0d04-0410-961f-82ee72b054a4" Date: Wed, 31 Mar 2010 09:19:20 +0000 Subject: [PATCH] gcc: * config/sol2.c: Include output.h. (solaris_assemble_visibility): New function. * config/t-sol2 (sol2.o): Add output.h dependency. * config/sol2-protos.h (solaris_assemble_visibility): Declare. * config/sol2.h [!USE_GAS] (TARGET_ASM_ASSEMBLE_VISIBILITY): Redefine. gcc/testsuite: * g++.dg/ext/visibility/pragma-override1.C: Allow for .hidden in assembler output on *-*-solaris2*. * g++.dg/ext/visibility/pragma-override2.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157856 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/config/sol2.c | 7 ++++--- gcc/config/sol2.h | 5 +++++ gcc/testsuite/ChangeLog | 6 ++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c60dd5f5c4b..930e0000e3d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-03-31 Rainer Orth + + * config/sol2.c: Include output.h. + (solaris_assemble_visibility): New function. + * config/t-sol2 (sol2.o): Add output.h dependency. + * config/sol2-protos.h (solaris_assemble_visibility): Declare. + * config/sol2.h [!USE_GAS] (TARGET_ASM_ASSEMBLE_VISIBILITY): + Redefine. + 2010-03-31 Jakub Jelinek PR target/43580 diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c index 7c5f647e3e8..32fa4f354f2 100644 --- a/gcc/config/sol2.c +++ b/gcc/config/sol2.c @@ -122,10 +122,8 @@ solaris_output_init_fini (FILE *file, tree decl) the visibility type VIS, which must not be VISIBILITY_DEFAULT. */ void -solaris_assemble_visibility (tree decl ATTRIBUTE_UNUSED, - int vis ATTRIBUTE_UNUSED) +solaris_assemble_visibility (tree decl, int vis) { -#ifdef HAVE_GAS_HIDDEN /* Sun as uses .symbolic for STV_PROTECTED. STV_INTERNAL is marked as `currently reserved', but the linker treats it like STV_HIDDEN. Sun Studio 12.1 cc emits .hidden instead. @@ -148,6 +146,9 @@ solaris_assemble_visibility (tree decl ATTRIBUTE_UNUSED, name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); type = visibility_types[vis]; + /* .hidden dates back before Solaris 2.5, but .symbolic was only added in + Solaris 9 12/02. */ +#ifdef HAVE_GAS_HIDDEN fprintf (asm_out_file, "\t.%s\t", type); assemble_name (asm_out_file, name); fprintf (asm_out_file, "\n"); diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index e95686e7c03..98e54e6a92c 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -292,6 +292,11 @@ __enable_execute_stack (void *addr) \ } \ while (0) +#ifndef USE_GAS +#undef TARGET_ASM_ASSEMBLE_VISIBILITY +#define TARGET_ASM_ASSEMBLE_VISIBILITY solaris_assemble_visibility +#endif + extern GTY(()) tree solaris_pending_aligns; extern GTY(()) tree solaris_pending_inits; extern GTY(()) tree solaris_pending_finis; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 23abb904ce4..3489d8a1956 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-03-31 Rainer Orth + + * g++.dg/ext/visibility/pragma-override1.C: Allow for .hidden in + assembler output on *-*-solaris2*. + * g++.dg/ext/visibility/pragma-override2.C: Likewise. + 2010-03-31 Jakub Jelinek PR debug/43557 -- 2.11.0