aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2010-03-31 10:42:56 +0000
committerRainer Orth <ro@gcc.gnu.org>2010-03-31 10:42:56 +0000
commita0c210293eb6dd6cd5176af5e724eacfaa5e19f7 (patch)
tree56b3c89e38ee32ccfa037993c047f9f85ddcdd72
parenta3f410a2146cce18fc027f8cb3ad1496cb4a64ac (diff)
downloadgcc-a0c210293eb6dd6cd5176af5e724eacfaa5e19f7.zip
gcc-a0c210293eb6dd6cd5176af5e724eacfaa5e19f7.tar.gz
gcc-a0c210293eb6dd6cd5176af5e724eacfaa5e19f7.tar.bz2
sysv4.h (PUSHSECTION_FORMAT): Remove undef.
* 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
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/sol2.c4
-rw-r--r--gcc/config/sol2.h4
-rw-r--r--gcc/config/sparc/sol2.h9
-rw-r--r--gcc/config/sparc/sysv4.h8
5 files changed, 24 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 964204d..8d7b219 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c
index 3531e79..32fa4f3 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 d77c0f8..8f24bc7 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 294f987..a341bcf 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 c78add4..542f7c1 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); \