From: ro Date: Wed, 31 Mar 2010 10:42:56 +0000 (+0000) Subject: * config/sparc/sysv4.h (PUSHSECTION_FORMAT): Remove undef. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=64920f70305b9591ad45216b2a8edd891dbb4c58 * config/sparc/sysv4.h (PUSHSECTION_FORMAT): Remove undef. (PUSHSECTION_ASM_OP): Remove. (POPSECTION_ASM_OP): Remove. (PUSHSECTION_FORMAT): Remove. * config/sol2.h (PUSHSECTION_FORMAT): Define. * config/sparc/sol2.h [!USE_GAS] (PUSHSECTION_FORMAT): Redefine. * config/sol2.c (solaris_output_init_fini): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157861 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 964204d008e..8d7b219259a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2010-03-31 Rainer Orth + + * config/sparc/sysv4.h (PUSHSECTION_FORMAT): Remove undef. + (PUSHSECTION_ASM_OP): Remove. + (POPSECTION_ASM_OP): Remove. + (PUSHSECTION_FORMAT): Remove. + * config/sol2.h (PUSHSECTION_FORMAT): Define. + * config/sparc/sol2.h [!USE_GAS] (PUSHSECTION_FORMAT): Redefine. + * config/sol2.c (solaris_output_init_fini): Use it. + 2010-03-31 Jie Zhang PR 43574 diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c index 3531e799f5d..32fa4f354f2 100644 --- a/gcc/config/sol2.c +++ b/gcc/config/sol2.c @@ -105,14 +105,14 @@ solaris_output_init_fini (FILE *file, tree decl) { if (lookup_attribute ("init", DECL_ATTRIBUTES (decl))) { - fprintf (file, "\t.pushsection\t\".init\"\n"); + fprintf (file, PUSHSECTION_FORMAT, ".init"); ASM_OUTPUT_CALL (file, decl); fprintf (file, "\t.popsection\n"); } if (lookup_attribute ("fini", DECL_ATTRIBUTES (decl))) { - fprintf (file, "\t.pushsection\t\".fini\"\n"); + fprintf (file, PUSHSECTION_FORMAT, ".fini"); ASM_OUTPUT_CALL (file, decl); fprintf (file, "\t.popsection\n"); } diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index d77c0f8ba8b..8f24bc745f3 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -254,6 +254,10 @@ __enable_execute_stack (void *addr) \ { "init", 0, 0, true, false, false, NULL }, \ { "fini", 0, 0, true, false, false, NULL } +/* Solaris/x86 as and gas support the common ELF .section/.pushsection + syntax. */ +#define PUSHSECTION_FORMAT "\t.pushsection\t%s\n" + /* This is how to declare the size of a function. For Solaris, we output any .init or .fini entries here. */ #undef ASM_DECLARE_FUNCTION_SIZE diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h index 294f9874b01..a341bcfd30b 100644 --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for SPARC running Solaris 2 Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, - 2006, 2007, 2008 Free Software Foundation, Inc. + 2006, 2007, 2008, 2010 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@netcom.com). Additional changes by David V. Henkel-Wallace (gumby@cygnus.com). @@ -181,4 +181,11 @@ along with GCC; see the file COPYING3. If not see #undef TARGET_ASM_NAMED_SECTION #define TARGET_ASM_NAMED_SECTION sparc_solaris_elf_asm_named_section +/* Solaris/SPARC as uses a non-standard .section/.pushsection syntax. + While gas supports it, too, we prefer the standard variant. */ +#ifndef USE_GAS +#undef PUSHSECTION_FORMAT +#define PUSHSECTION_FORMAT "\t.pushsection\t\"%s\"\n" +#endif + #define MD_UNWIND_SUPPORT "config/sparc/sol2-unwind.h" diff --git a/gcc/config/sparc/sysv4.h b/gcc/config/sparc/sysv4.h index c78add484fe..542f7c1b055 100644 --- a/gcc/config/sparc/sysv4.h +++ b/gcc/config/sparc/sysv4.h @@ -42,7 +42,6 @@ along with GCC; see the file COPYING3. If not see #undef FINI_SECTION_ASM_OP #undef READONLY_DATA_SECTION_ASM_OP #undef TYPE_OPERAND_FMT -#undef PUSHSECTION_FORMAT #undef STRING_ASM_OP #undef COMMON_ASM_OP #undef SKIP_ASM_OP @@ -63,19 +62,12 @@ along with GCC; see the file COPYING3. If not see #define STRING_ASM_OP "\t.asciz\t" #define COMMON_ASM_OP "\t.common\t" #define SKIP_ASM_OP "\t.skip\t" -#define PUSHSECTION_ASM_OP "\t.pushsection\t" -#define POPSECTION_ASM_OP "\t.popsection" /* This is the format used to print the second operand of a .type pseudo-op for the SPARC/svr4 assembler. */ #define TYPE_OPERAND_FMT "#%s" -/* This is the format used to print a .pushsection pseudo-op (and its operand) - for the SPARC/svr4 assembler. */ - -#define PUSHSECTION_FORMAT "%s\"%s\"\n" - #undef ASM_OUTPUT_CASE_LABEL #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \