sysv4.h (PUSHSECTION_FORMAT): Remove undef.
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 31 Mar 2010 10:42:56 +0000 (10:42 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 31 Mar 2010 10:42:56 +0000 (10:42 +0000)
* 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.

From-SVN: r157861

gcc/ChangeLog
gcc/config/sol2.c
gcc/config/sol2.h
gcc/config/sparc/sol2.h
gcc/config/sparc/sysv4.h

index 964204d..8d7b219 100644 (file)
@@ -1,3 +1,13 @@
+2010-03-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * 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  <jie@codesourcery.com>
 
        PR 43574
index 3531e79..32fa4f3 100644 (file)
@@ -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");
     }
index d77c0f8..8f24bc7 100644 (file)
@@ -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
index 294f987..a341bcf 100644 (file)
@@ -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"
index c78add4..542f7c1 100644 (file)
@@ -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);               \