OSDN Git Service

* final.c (HAVE_READONLY_DATA_SECTION): New.
[pf3gnuchains/gcc-fork.git] / gcc / config / i860 / sysv4.h
index 3108a74..753807f 100644 (file)
@@ -1,7 +1,6 @@
 /* Target definitions for GNU compiler for Intel 80860 running System V.4
-   Copyright (C) 1991 Free Software Foundation, Inc.
-
-   Written by Ron Guilmette (rfg@netcom.com).
+   Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc.
+   Contributed by Ron Guilmette (rfg@monkeys.com).
 
 This file is part of GNU CC.
 
@@ -17,10 +16,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
-
-#include "i860/i860.h"
-#include "svr4.h"
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #undef TARGET_VERSION
 #define TARGET_VERSION fprintf (stderr, " (i860 System V Release 4)");
@@ -35,7 +32,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    __svr4__ is our extension.  */
 
 #define CPP_PREDEFINES \
-  "-Di860 -Dunix -DSVR4 -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(i860) -Amachine(i860)"
+  "-Di860 -Dunix -DSVR4 -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=i860 -Amachine=i860"
+
+/* For the benefit of i860_va_arg, flag it this way too.  */
+
+#define I860_SVR4_VA_LIST 1
 
 /* The prefix to be used in assembler output for all names of registers.
    This string gets prepended to all i860 register names (svr4 only).  */
@@ -47,8 +48,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #undef TYPE_OPERAND_FMT
 #define TYPE_OPERAND_FMT      "\"%s\""
 
-#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
-
 /* The following macro definition overrides the one in i860.h
    because the svr4 i860 assembler requires a different syntax
    for getting parts of constant/relocatable values.  */
@@ -60,55 +59,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
        fprintf (FILE, "]@%s", PART_CODE);                              \
   } while (0)
 
-/* If the host and target formats match, output the floats as hex.  */
-#if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
-#if defined (HOST_WORDS_BIG_ENDIAN) == WORDS_BIG_ENDIAN
-
-/* This is how to output an assembler line defining a `double' constant.
-   Note that the native i860/svr4 ELF assembler can't properly handle
-   infinity.  It generates an incorrect (non-infinity) value when given
-   `.double 99e9999' and it doesn't grok `inf' at all.  It also mishandles
-   NaNs and -0.0.  */
-
-#undef ASM_OUTPUT_DOUBLE
-#define ASM_OUTPUT_DOUBLE(FILE,VALUE)                                  \
-  {                                                                    \
-    if (REAL_VALUE_ISINF (VALUE)                                       \
-        || REAL_VALUE_ISNAN (VALUE)                                    \
-       || REAL_VALUE_MINUS_ZERO (VALUE))                               \
-      {                                                                        \
-       long t[2];                                                      \
-       REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t);                       \
-       fprintf (FILE, "\t.word 0x%lx\n\t.word 0x%lx\n", t[0], t[1]);   \
-      }                                                                        \
-    else                                                               \
-      fprintf (FILE, "\t.double %.20e\n", VALUE);                      \
-  }
-
-/* This is how to output an assembler line defining a `float' constant.
-   Note that the native i860/svr4 ELF assembler can't properly handle
-   infinity.  It actually generates an assembly time error when given
-   `.float 99e9999' and it doesn't grok `inf' at all.  It also mishandles
-   NaNs and -0.0.  */
-
-#undef ASM_OUTPUT_FLOAT
-#define ASM_OUTPUT_FLOAT(FILE,VALUE)                                   \
-  {                                                                    \
-    if (REAL_VALUE_ISINF (VALUE)                                       \
-        || REAL_VALUE_ISNAN (VALUE)                                    \
-       || REAL_VALUE_MINUS_ZERO (VALUE))                               \
-      {                                                                        \
-       long t;                                                         \
-       REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t);                       \
-       fprintf (FILE, "\t.word 0x%lx\n", t);                           \
-      }                                                                        \
-    else                                                               \
-      fprintf (FILE, "\t.float %.12e\n", VALUE);                       \
-  }
-
-#endif /* word order matches */
-#endif /* HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT */
-
 #undef ASM_FILE_START
 #define ASM_FILE_START(FILE)                                           \
   do { output_file_directive (FILE, main_input_filename);              \
@@ -118,7 +68,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Output the special word the svr4 SDB wants to see just before
    the first word of each function's prologue code.  */
 
-extern char *current_function_original_name;
+extern const char *current_function_original_name;
 
 /* This special macro is used to output a magic word just before the
    first word of each function.  On some versions of UNIX running on
@@ -148,24 +98,36 @@ extern char *current_function_original_name;
        fprintf (FILE, ":\n");                                          \
   } while (0)
 
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+   Note that we want to give these sections the SHF_WRITE attribute
+   because these sections will actually contain data (i.e. tables of
+   addresses of functions in the current root executable or shared library
+   file) and, in the case of a shared library, the relocatable addresses
+   will have to be properly resolved/relocated (and then written into) by
+   the dynamic linker when it actually attaches the given shared library
+   to the executing process.  (Note that on SVR4, you may wish to use the
+   `-z text' option to the ELF linker, when building a shared library, as
+   an additional check that you are doing everything right.  But if you do
+   use the `-z text' option when building a shared library, you will get
+   errors unless the .ctors and .dtors sections are marked as writable
+   via the SHF_WRITE attribute.)  */
 #undef CTORS_SECTION_ASM_OP
-#define CTORS_SECTION_ASM_OP   ".section\t.ctors,\"a\",\"progbits\""
+#define CTORS_SECTION_ASM_OP   "\t.section\t.ctors,\"aw\""
 #undef DTORS_SECTION_ASM_OP
-#define DTORS_SECTION_ASM_OP   ".section\t.dtors,\"a\",\"progbits\""
+#define DTORS_SECTION_ASM_OP   "\t.section\t.dtors,\"aw\""
 
 /* Add definitions to support the .tdesc section as specified in the svr4
    ABI for the i860.  */
 
-#define TDESC_SECTION_ASM_OP    ".section\t.tdesc"
+#define TDESC_SECTION_ASM_OP    "\t.section\t.tdesc"
 
 #undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_tdesc
+#define EXTRA_SECTIONS in_tdesc
 
 #undef EXTRA_SECTION_FUNCTIONS
 #define EXTRA_SECTION_FUNCTIONS                                                \
-  CONST_SECTION_FUNCTION                                               \
-  CTORS_SECTION_FUNCTION                                               \
-  DTORS_SECTION_FUNCTION                                               \
   TDESC_SECTION_FUNCTION
 
 #define TDESC_SECTION_FUNCTION                                         \
@@ -179,18 +141,3 @@ tdesc_section ()                                                   \
     }                                                                  \
 }
 
-#ifdef OUTPUT_TDESC
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE)                                     \
-do {                                                           \
-     if (current_function_original_name != NULL) {             \
-       tdesc_section();                                                \
-       fprintf ((FILE), "%s __ETEXT\n", ASM_LONG);             \
-       fprintf ((FILE), "%s 0\n", ASM_LONG);                   \
-       text_section();                                         \
-       fputs("__ETEXT:\n", (FILE));                            \
-     }                                                         \
-     fprintf ((FILE), "\t.ident\t\"GCC: (GNU) %s\"\n",         \
-             version_string);                                  \
-   } while (0)
-#endif