OSDN Git Service

* defaults.h (ASM_OUTPUT_TYPE_DIRECTIVE, ASM_OUTPUT_SIZE_DIRECTIVE,
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / sysv4.h
index 56e16ba..5db8487 100644 (file)
@@ -1,5 +1,5 @@
 /* Target definitions for GNU compiler for PowerPC running System V.4
-   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
@@ -34,10 +34,6 @@ Boston, MA 02111-1307, USA.  */
 #undef ASM_DEFAULT_SPEC
 #define        ASM_DEFAULT_SPEC "-mppc"
 
-/* Override rs6000.h definition.  */
-#undef CPP_DEFAULT_SPEC
-#define        CPP_DEFAULT_SPEC "-D_ARCH_PPC"
-
 /* Small data support types.  */
 enum rs6000_sdata_type {
   SDATA_NONE,                  /* No small data support.  */
@@ -152,6 +148,7 @@ extern int g_switch_set;            /* Whether -G xx was passed.  */
   { "emb",              0,                                             \
     N_("Set the PPC_EMB bit in the ELF flags header") },               \
   { "vxworks",          0, N_("no description yet") },                 \
+  { "windiss",           0, N_("Use the WindISS simulator") },          \
   { "shlib",            0, N_("no description yet") },                 \
   EXTRA_SUBTARGET_SWITCHES                                             \
   { "newlib",           0, N_("no description yet") },
@@ -197,6 +194,8 @@ do {                                                                        \
     rs6000_current_abi = ABI_V4;                                       \
   else if (!strcmp (rs6000_abi_name, "linux"))                         \
     rs6000_current_abi = ABI_V4;                                       \
+  else if (!strcmp (rs6000_abi_name, "gnu"))                           \
+    rs6000_current_abi = ABI_V4;                                       \
   else if (!strcmp (rs6000_abi_name, "netbsd"))                                \
     rs6000_current_abi = ABI_V4;                                       \
   else if (!strcmp (rs6000_abi_name, "i960-old"))                      \
@@ -381,10 +380,6 @@ do {                                                                       \
 /* Real stack boundary as mandated by the appropriate ABI.  */
 #define ABI_STACK_BOUNDARY ((TARGET_EABI && !TARGET_ALTIVEC_ABI) ? 64 : 128)
 
-/* No data type wants to be aligned rounder than this.  */
-#undef BIGGEST_ALIGNMENT
-#define BIGGEST_ALIGNMENT (TARGET_EABI ? 64 : 128)
-
 /* An expression for the alignment of a structure field FIELD if the
    alignment computed in the usual way is COMPUTED.  */
 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                                  \
@@ -397,7 +392,8 @@ do {                                                                        \
    SPECIFIED.  */
 #define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED)                    \
        ((TARGET_ALTIVEC  && TREE_CODE (TYPE) == VECTOR_TYPE)           \
-        ? 128 : MAX (COMPUTED, SPECIFIED))
+        ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128)                     \
+         : MAX (COMPUTED, SPECIFIED))
 
 #undef  BIGGEST_FIELD_ALIGNMENT
 #undef  ADJUST_FIELD_ALIGN
@@ -431,12 +427,11 @@ do {                                                                      \
 /* Besides the usual ELF sections, we need a toc section.  */
 /* Override elfos.h definition.  */
 #undef EXTRA_SECTIONS
-#define        EXTRA_SECTIONS in_const, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
+#define        EXTRA_SECTIONS in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
 
 /* Override elfos.h definition.  */
 #undef EXTRA_SECTION_FUNCTIONS
 #define        EXTRA_SECTION_FUNCTIONS                                         \
-  CONST_SECTION_FUNCTION                                               \
   TOC_SECTION_FUNCTION                                                 \
   SDATA_SECTION_FUNCTION                                               \
   SDATA2_SECTION_FUNCTION                                              \
@@ -485,6 +480,12 @@ toc_section ()                                                             \
            }                                                           \
        }                                                               \
     }                                                                  \
+}                                                                      \
+                                                                       \
+extern int in_toc_section PARAMS ((void));                             \
+int in_toc_section ()                                                  \
+{                                                                      \
+  return in_section == in_toc;                                         \
 }
 
 #define        SDATA_SECTION_FUNCTION                                          \
@@ -542,39 +543,12 @@ fini_section ()                                                           \
     }                                                                  \
 }
 
-/* A C statement or statements to switch to the appropriate section
-   for output of RTX in mode MODE.  You can assume that RTX is some
-   kind of constant in RTL.  The argument MODE is redundant except in
-   the case of a `const_int' rtx.  Select the section by calling
-   `text_section' or one of the alternatives for other sections.
-
-   Do not define this macro if you put all constants in the read-only
-   data section.  */
-
-/* Override elfos.h definition.  */
-#undef SELECT_RTX_SECTION
-#define        SELECT_RTX_SECTION(MODE, X, ALIGN) rs6000_select_rtx_section (MODE, X)
-
-/* A C statement or statements to switch to the appropriate
-   section for output of DECL.  DECL is either a `VAR_DECL' node
-   or a constant of some sort.  RELOC indicates whether forming
-   the initial value of DECL requires link-time relocations.  */
-
-/* Override elfos.h definition.  */
-#undef SELECT_SECTION
-#define        SELECT_SECTION(DECL, RELOC, ALIGN) rs6000_select_section (DECL, RELOC)
-
-/* A C statement to build up a unique section name, expressed as a
-   STRING_CST node, and assign it to DECL_SECTION_NAME (decl).
-   RELOC indicates whether the initial value of EXP requires
-   link-time relocations.  If you do not define this macro, GCC will use
-   the symbol name prefixed by `.' as the section name.  Note - this
-   macro can now be called for uninitialized data items as well as
-   initialised data and functions.  */
-
-/* Override elfos.h definition.  */
-#undef UNIQUE_SECTION
-#define UNIQUE_SECTION(DECL, RELOC) rs6000_unique_section (DECL, RELOC)
+/* Override default elf definitions.  */
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define        TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section
+#undef TARGET_ASM_SELECT_SECTION
+#define        TARGET_ASM_SELECT_SECTION  rs6000_elf_select_section
+#define TARGET_ASM_UNIQUE_SECTION  rs6000_elf_unique_section
 
 /* Return non-zero if this entry is to be written into the constant pool
    in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
@@ -619,7 +593,8 @@ extern int rs6000_pic_labelno;
   do {                                                                 \
     const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long";   \
                                                                        \
-    if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag)  \
+    if (TARGET_RELOCATABLE                                             \
+       && (get_pool_size () != 0 || current_function_profile)          \
        && uses_TOC())                                                  \
       {                                                                        \
        char buf[256];                                                  \
@@ -635,18 +610,14 @@ extern int rs6000_pic_labelno;
        putc ('\n', FILE);                                              \
       }                                                                        \
                                                                        \
-    fprintf (FILE, "%s", TYPE_ASM_OP);                                 \
-    assemble_name (FILE, NAME);                                                \
-    putc (',', FILE);                                                  \
-    fprintf (FILE, TYPE_OPERAND_FMT, "function");                      \
-    putc ('\n', FILE);                                                 \
+    ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");                        \
     ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));                     \
                                                                        \
     if (DEFAULT_ABI == ABI_AIX)                                                \
       {                                                                        \
        const char *desc_name, *orig_name;                              \
                                                                        \
-        STRIP_NAME_ENCODING (orig_name, NAME);                         \
+        orig_name = (*targetm.strip_name_encoding) (NAME);             \
         desc_name = orig_name;                                         \
        while (*desc_name == '.')                                       \
          desc_name++;                                                  \
@@ -740,11 +711,7 @@ do {                                                                       \
       ASM_OUTPUT_LABEL (FILE, NAME);                                   \
       ASM_OUTPUT_SKIP (FILE, SIZE);                                    \
       if (!flag_inhibit_size_directive && (SIZE) > 0)                  \
-       {                                                               \
-         fprintf (FILE, "%s", SIZE_ASM_OP);                            \
-         assemble_name (FILE, NAME);                                   \
-         fprintf (FILE, ",%d\n",  SIZE);                               \
-       }                                                               \
+       ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);                   \
     }                                                                  \
   else                                                                 \
     {                                                                  \
@@ -761,6 +728,34 @@ do {                                                                       \
   ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN);                  \
 } while (0)
 
+/* This is how to output code to push a register on the stack.
+   It need not be very fast code.
+
+   On the rs6000, we must keep the backchain up to date.  In order
+   to simplify things, always allocate 16 bytes for a push (System V
+   wants to keep stack aligned to a 16 byte boundary).  */
+
+#define        ASM_OUTPUT_REG_PUSH(FILE, REGNO)                                \
+do {                                                                   \
+  if (DEFAULT_ABI == ABI_V4)                                           \
+    asm_fprintf (FILE,                                                 \
+                "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n",     \
+                reg_names[1], reg_names[1], reg_names[REGNO],          \
+                reg_names[1]);                                         \
+} while (0)
+
+/* This is how to output an insn to pop a register from the stack.
+   It need not be very fast code.  */
+
+#define        ASM_OUTPUT_REG_POP(FILE, REGNO)                                 \
+do {                                                                   \
+  if (DEFAULT_ABI == ABI_V4)                                           \
+    asm_fprintf (FILE,                                                 \
+                "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n",        \
+                reg_names[REGNO], reg_names[1], reg_names[1],          \
+                reg_names[1]);                                         \
+} while (0)
+
 /* Switch  Recognition by gcc.c.  Add -G xx support.  */
 
 /* Override svr4.h definition.  */
@@ -788,59 +783,6 @@ extern int fixuplabelno;
 #define TARGET_ASM_CONSTRUCTOR  rs6000_elf_asm_out_constructor
 #define TARGET_ASM_DESTRUCTOR   rs6000_elf_asm_out_destructor
 
-/* This is how to output an assembler line defining an `int' constant.
-   For -mrelocatable, we mark all addresses that need to be fixed up
-   in the .fixup section.  */
-/* Override rs6000.h definition.  */
-#undef ASM_OUTPUT_INT
-#define ASM_OUTPUT_INT(FILE,VALUE)                                     \
-do {                                                                   \
-  static int recurse = 0;                                              \
-  if (TARGET_RELOCATABLE                                               \
-      && in_section != in_toc                                          \
-      && in_section != in_text                                         \
-      && !recurse                                                      \
-      && GET_CODE (VALUE) != CONST_INT                                 \
-      && GET_CODE (VALUE) != CONST_DOUBLE                              \
-      && CONSTANT_P (VALUE))                                           \
-    {                                                                  \
-      char buf[256];                                                   \
-                                                                       \
-      recurse = 1;                                                     \
-      ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", fixuplabelno);          \
-      fixuplabelno++;                                                  \
-      ASM_OUTPUT_LABEL (FILE, buf);                                    \
-      fprintf (FILE, "\t.long (");                                     \
-      output_addr_const (FILE, (VALUE));                               \
-      fprintf (FILE, ")@fixup\n");                                     \
-      fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n");               \
-      ASM_OUTPUT_ALIGN (FILE, 2);                                      \
-      fprintf (FILE, "\t.long\t");                                     \
-      assemble_name (FILE, buf);                                       \
-      fprintf (FILE, "\n\t.previous\n");                               \
-      recurse = 0;                                                     \
-    }                                                                  \
-  /* Remove initial .'s to turn a -mcall-aixdesc function              \
-     address into the address of the descriptor, not the function      \
-     itself.  */                                                       \
-  else if (GET_CODE (VALUE) == SYMBOL_REF                              \
-          && XSTR (VALUE, 0)[0] == '.'                                 \
-          && DEFAULT_ABI == ABI_AIX)                                   \
-    {                                                                  \
-      const char *name = XSTR (VALUE, 0);                              \
-      while (*name == '.')                                             \
-       name++;                                                         \
-                                                                       \
-      fprintf (FILE, "\t.long %s\n", name);                            \
-    }                                                                  \
-  else                                                                 \
-    {                                                                  \
-      fprintf (FILE, "\t.long ");                                      \
-      output_addr_const (FILE, (VALUE));                               \
-      fprintf (FILE, "\n");                                            \
-    }                                                                  \
-} while (0)
-
 /* This is the end of what might become sysv4.h.  */
 
 /* Use DWARF 2 debugging information by default.  */
@@ -850,33 +792,14 @@ do {                                                                      \
 /* Historically we have also supported stabs debugging.  */
 #define        DBX_DEBUGGING_INFO
 
-/* If we are referencing a function that is static or is known to be
-   in this file, make the SYMBOL_REF special.  We can use this to indicate
-   that we can branch to this function without emitting a no-op after the
-   call.  For real AIX calling sequences, we also replace the
-   function name with the real name (1 or 2 leading .'s), rather than
-   the function descriptor name.  This saves a lot of overriding code
-   to read the prefixes.  */
-
-#undef ENCODE_SECTION_INFO
-#define        ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
+#define        TARGET_ENCODE_SECTION_INFO  rs6000_elf_encode_section_info
+#define        TARGET_STRIP_NAME_ENCODING  rs6000_elf_strip_name_encoding
 
 /* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
 
 #define        RS6000_OUTPUT_BASENAME(FILE, NAME)      \
     assemble_name (FILE, NAME)
 
-/* This macro gets just the user-specified name
-   out of the string in a SYMBOL_REF.  Discard
-   a leading * or @.  */
-#define        STRIP_NAME_ENCODING(VAR,SYMBOL_NAME)                            \
-do {                                                                   \
-  const char *_name = SYMBOL_NAME;                                     \
-  while (*_name == '*' || *_name == '@')                               \
-    _name++;                                                           \
-  (VAR) = _name;                                                       \
-} while (0)
-
 /* This is how to output a reference to a user-level label named NAME.
    `assemble_name' uses this.  */
 
@@ -905,9 +828,19 @@ do {                                               \
 #define        TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
 #endif
 \f
-#ifndef        CPP_PREDEFINES
-#define        CPP_PREDEFINES \
-  "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc"
+#ifndef        TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()          \
+  do                                      \
+    {                                     \
+      builtin_define_std ("PPC");         \
+      builtin_define_std ("unix");        \
+      builtin_define ("__svr4__");        \
+      builtin_assert ("system=unix");     \
+      builtin_assert ("system=svr4");     \
+      builtin_assert ("cpu=powerpc");     \
+      builtin_assert ("machine=powerpc"); \
+    }                                     \
+  while (0)
 #endif
 
 /* Pass various options to the assembler.  */
@@ -923,6 +856,7 @@ do {                                                \
     %{mcall-freebsd: -mbig} \
     %{mcall-i960-old: -mlittle} \
     %{mcall-linux: -mbig} \
+    %{mcall-gnu: -mbig} \
     %{mcall-netbsd: -mbig} \
 }}}}"
 
@@ -935,7 +869,7 @@ do {                                                \
     } \
 }}"
 
-#define        CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big_spec)"
+#define        CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)"
 
 /* Pass -G xxx to the compiler and set correct endian mode.  */
 #define        CC1_SPEC "%{G*} \
@@ -946,10 +880,11 @@ do {                                              \
     %{mcall-freebsd: -mbig %(cc1_endian_big) } \
     %{mcall-i960-old: -mlittle %(cc1_endian_little) } \
     %{mcall-linux: -mbig %(cc1_endian_big) } \
+    %{mcall-gnu: -mbig %(cc1_endian_big) } \
     %{mcall-netbsd: -mbig %(cc1_endian_big) } \
-    %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-netbsd: \
+    %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd: \
            %(cc1_endian_default) \
-    }}}}} \
+    }}}}}} \
 }}}} \
 %{mno-sdata: -msdata=none } \
 %{meabi: %{!mcall-*: -mcall-sysv }} \
@@ -958,6 +893,7 @@ do {                                                \
     %{mcall-freebsd: -mno-eabi } \
     %{mcall-i960-old: -meabi } \
     %{mcall-linux: -mno-eabi } \
+    %{mcall-gnu: -mno-eabi } \
     %{mcall-netbsd: -mno-eabi }}} \
 %{msdata: -msdata=default} \
 %{mno-sdata: -msdata=none} \
@@ -986,11 +922,14 @@ do {                                              \
 %{myellowknife: %(link_start_yellowknife) } \
 %{mmvme: %(link_start_mvme) } \
 %{msim: %(link_start_sim) } \
+%{mwindiss: %(link_start_windiss) } \
 %{mcall-freebsd: %(link_start_freebsd) } \
 %{mcall-linux: %(link_start_linux) } \
+%{mcall-gnu: %(link_start_gnu) } \
 %{mcall-netbsd: %(link_start_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: \
-       %{!mcall-netbsd: %{!mcall-freebsd: %(link_start_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
+         %{!mcall-linux: %{!mcall-gnu: %{!mcall-netbsd:   \
+         %{!mcall-freebsd: %(link_start_default) }}}}}}}}}"
 
 #define LINK_START_DEFAULT_SPEC ""
 
@@ -1042,71 +981,37 @@ do {                                             \
 %{myellowknife: %(link_os_yellowknife) } \
 %{mmvme: %(link_os_mvme) } \
 %{msim: %(link_os_sim) } \
+%{mwindiss: %(link_os_windiss) } \
 %{mcall-freebsd: %(link_os_freebsd) } \
 %{mcall-linux: %(link_os_linux) } \
+%{mcall-gnu: %(link_os_gnu) } \
 %{mcall-netbsd: %(link_os_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %(link_os_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
+         %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
+         %{!mcall-netbsd: %(link_os_default) }}}}}}}}}"
 
 #define LINK_OS_DEFAULT_SPEC ""
 
 #define CPP_SYSV_SPEC \
 "%{mrelocatable*: -D_RELOCATABLE} \
 %{fpic: -D__PIC__=1 -D__pic__=1} \
-%{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}} \
-%{mlong-double-128: -D__LONG_DOUBLE_128__=1} \
-%{!mlong-double-64: %(cpp_longdouble_default)} \
-%{mcall-sysv: -D_CALL_SYSV} \
-%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
-%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %(cpp_sysv_default) }}} \
-%{msoft-float: -D_SOFT_FLOAT} \
-%{!msoft-float: %{!mhard-float: \
-    %{mcpu=401: -D_SOFT_FLOAT} \
-    %{mcpu=403: -D_SOFT_FLOAT} \
-    %{mcpu=ec603e: -D_SOFT_FLOAT} \
-    %{mcpu=801: -D_SOFT_FLOAT} \
-    %{mcpu=821: -D_SOFT_FLOAT} \
-    %{mcpu=823: -D_SOFT_FLOAT} \
-    %{mcpu=860: -D_SOFT_FLOAT} \
-    %{!mcpu*: %(cpp_float_default) }}}"
-
-/* Whether floating point is disabled by default.  */
-#define        CPP_FLOAT_DEFAULT_SPEC ""
-
-/* Whether 'long double' is 128 bits by default.  */
-#define        CPP_LONGDOUBLE_DEFAULT_SPEC ""
-
-#define        CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV"
-
-#define CPP_ENDIAN_BIG_SPEC "-D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian"
-
-#define CPP_ENDIAN_LITTLE_SPEC "-D_LITTLE_ENDIAN -D__LITTLE_ENDIAN__ -Amachine=littleendian"
-
-#define        CPP_ENDIAN_SPEC \
-"%{mlittle: %(cpp_endian_little) } \
-%{mlittle-endian: %(cpp_endian_little) } \
-%{mbig: %(cpp_endian_big) } \
-%{mbig-endian: %(cpp_endian_big) } \
-%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
-    %{mcall-freebsd: %(cpp_endian_big) } \
-    %{mcall-linux: %(cpp_endian_big) } \
-    %{mcall-netbsd: %(cpp_endian_big) } \
-    %{mcall-i960-old: %(cpp_endian_little) } \
-    %{mcall-aixdesc:  %(cpp_endian_big) } \
-    %{!mcall-linux: %{!mcall-freebsd: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
-
-#define        CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
+%{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}}"
 
 /* Override rs6000.h definition.  */
 #undef CPP_SPEC
-#define        CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) \
+#define        CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) \
 %{mads: %(cpp_os_ads) } \
 %{myellowknife: %(cpp_os_yellowknife) } \
 %{mmvme: %(cpp_os_mvme) } \
 %{msim: %(cpp_os_sim) } \
+%{mwindiss: %(cpp_os_windiss) } \
 %{mcall-freebsd: %(cpp_os_freebsd) } \
 %{mcall-linux: %(cpp_os_linux) } \
+%{mcall-gnu: %(cpp_os_gnu) } \
 %{mcall-netbsd: %(cpp_os_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %(cpp_os_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
+         %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
+         %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}}"
 
 #define        CPP_OS_DEFAULT_SPEC ""
 
@@ -1117,10 +1022,14 @@ do {                                            \
 %{myellowknife: %(startfile_yellowknife) } \
 %{mmvme: %(startfile_mvme) } \
 %{msim: %(startfile_sim) } \
+%{mwindiss: %(startfile_windiss) } \
 %{mcall-freebsd: %(startfile_freebsd) } \
 %{mcall-linux: %(startfile_linux) } \
+%{mcall-gnu: %(startfile_gnu) } \
 %{mcall-netbsd: %(startfile_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %(startfile_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
+         %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
+         %{!mcall-netbsd: %(startfile_default) }}}}}}}}}"
 
 #define        STARTFILE_DEFAULT_SPEC ""
 
@@ -1131,25 +1040,36 @@ do {                                            \
 %{myellowknife: %(lib_yellowknife) } \
 %{mmvme: %(lib_mvme) } \
 %{msim: %(lib_sim) } \
+%{mwindiss: %(lib_windiss) } \
 %{mcall-freebsd: %(lib_freebsd) } \
 %{mcall-linux: %(lib_linux) } \
+%{mcall-gnu: %(lib_gnu) } \
 %{mcall-netbsd: %(lib_netbsd) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %(lib_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
+         %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
+         %{!mcall-netbsd: %(lib_default) }}}}}}}}}"
 
 #define LIB_DEFAULT_SPEC ""
 
 /* Override svr4.h definition.  */
 #undef ENDFILE_SPEC
 #define        ENDFILE_SPEC "\
-%{mads: %(endfile_ads)} \
-%{myellowknife: %(endfile_yellowknife)} \
-%{mmvme: %(endfile_mvme)} \
-%{msim: %(endfile_sim)} \
-%{mcall-freebsd: %(endfile_freebsd) } \
-%{mcall-linux: %(endfile_linux) } \
-%{mcall-netbsd: %(endfile_netbsd) } \
-%{mvxworks: %(endfile_vxworks) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mvxworks: %(endfile_default) }}}}}}}}"
+%{mads: crtsavres.o%s %(endfile_ads)} \
+%{myellowknife: crtsavres.o%s %(endfile_yellowknife)} \
+%{mmvme: crtsavres.o%s %(endfile_mvme)} \
+%{msim: crtsavres.o%s %(endfile_sim)} \
+%{mwindiss: %(endfile_windiss)} \
+%{mcall-freebsd: crtsavres.o%s %(endfile_freebsd) } \
+%{mcall-linux: crtsavres.o%s %(endfile_linux) } \
+%{mcall-gnu: crtsavres.o%s %(endfile_gnu) } \
+%{mcall-netbsd: crtsavres.o%s %(endfile_netbsd) } \
+%{mvxworks: crtsavres.o%s %(endfile_vxworks) } \
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \
+         %{!mcall-freebsd: %{!mcall-linux: %{!mcall-gnu: \
+         %{!mcall-netbsd: %{!mvxworks: %(crtsavres_default) \
+                                       %(endfile_default) }}}}}}}}}}"
+
+#define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
 
 #define        ENDFILE_DEFAULT_SPEC ""
 
@@ -1229,10 +1149,18 @@ do {                                            \
 %{profile:-lc_p} %{!profile:-lc}}}"
 #endif
 
+#ifdef USE_GNULIBC_1
 #define        STARTFILE_LINUX_SPEC "\
 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+#else
+#define        STARTFILE_LINUX_SPEC "\
+%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
+%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
+%{static:crtbeginT.o%s} \
+%{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+#endif
 
 #define        ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
 %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
@@ -1243,22 +1171,51 @@ do {                                            \
   %{rdynamic:-export-dynamic} \
   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
 
+#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
+# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+#endif
+
 #ifdef USE_GNULIBC_1
-#define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__              \
-%{!undef:                                                      \
-  %{!ansi:                                                     \
-    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                        \
-    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}            \
+#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
+%{!undef:                                                        \
+  %{!ansi:                                                       \
+    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                          \
+    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}              \
 -Asystem=unix -Asystem=posix"
 #else
-#define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__              \
-%{!undef:                                                      \
-  %{!ansi:                                                     \
-    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                        \
-    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}            \
+#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
+%{!undef:                                                        \
+  %{!ansi:                                                       \
+    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                          \
+    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}              \
 -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
 #endif
 
+/* GNU/Hurd support.  */
+#define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
+%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
+%{profile:-lc_p} %{!profile:-lc}}}"
+
+#define        STARTFILE_GNU_SPEC "\
+%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} \
+%{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
+%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
+%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+#define        ENDFILE_GNU_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
+%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
+
+#define LINK_START_GNU_SPEC ""
+
+#define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+  %{rdynamic:-export-dynamic} \
+  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
+
+#define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__   \
+%{!undef:                                                      \
+  %{!ansi: -Dunix -D__unix}}                                   \
+-Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
+
 /* NetBSD support.  */
 #define LIB_NETBSD_SPEC "\
 %{profile:-lgmon -lc_p} %{!profile:-lc}"
@@ -1307,6 +1264,7 @@ ncrtn.o%s"
 %{mcpu=powerpc: -DCPU=PPC603} \
 %{mcpu=401: -DCPU=PPC403} \
 %{mcpu=403: -DCPU=PPC403} \
+%{mcpu=405: -DCPU=PPC405} \
 %{mcpu=601: -DCPU=PPC601} \
 %{mcpu=602: -DCPU=PPC603} \
 %{mcpu=603: -DCPU=PPC603} \
@@ -1323,40 +1281,63 @@ ncrtn.o%s"
 %{mcpu=823: -DCPU=PPC603} \
 %{mcpu=860: -DCPU=PPC603}"
 
+/* WindISS support.  */
+
+#define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group"
+
+#define CPP_OS_WINDISS_SPEC "\
+-D__rtasim \
+-D__EABI__ \
+-D__ppc \
+%{!msoft-float: -D__hardfp} \
+"
+
+#define STARTFILE_WINDISS_SPEC "crt0.o%s crtbegin.o%s"
+
+#define ENDFILE_WINDISS_SPEC "crtend.o%s"
+
+#define LINK_START_WINDISS_SPEC ""
+
+#define LINK_OS_WINDISS_SPEC ""
+
 /* Define any extra SPECS that the compiler needs to generate.  */
 /* Override rs6000.h definition.  */
 #undef SUBTARGET_EXTRA_SPECS
 #define        SUBTARGET_EXTRA_SPECS                                           \
   { "cpp_sysv",                        CPP_SYSV_SPEC },                        \
-  { "cpp_sysv_default",                CPP_SYSV_DEFAULT_SPEC },                \
-  { "cpp_endian_default",      CPP_ENDIAN_DEFAULT_SPEC },              \
-  { "cpp_endian",              CPP_ENDIAN_SPEC },                      \
+  { "crtsavres_default",        CRTSAVRES_DEFAULT_SPEC },              \
   { "lib_ads",                 LIB_ADS_SPEC },                         \
   { "lib_yellowknife",         LIB_YELLOWKNIFE_SPEC },                 \
   { "lib_mvme",                        LIB_MVME_SPEC },                        \
   { "lib_sim",                 LIB_SIM_SPEC },                         \
   { "lib_freebsd",             LIB_FREEBSD_SPEC },                     \
+  { "lib_gnu",                 LIB_GNU_SPEC },                         \
   { "lib_linux",               LIB_LINUX_SPEC },                       \
   { "lib_netbsd",              LIB_NETBSD_SPEC },                      \
   { "lib_vxworks",             LIB_VXWORKS_SPEC },                     \
+  { "lib_windiss",              LIB_WINDISS_SPEC },                     \
   { "lib_default",             LIB_DEFAULT_SPEC },                     \
   { "startfile_ads",           STARTFILE_ADS_SPEC },                   \
   { "startfile_yellowknife",   STARTFILE_YELLOWKNIFE_SPEC },           \
   { "startfile_mvme",          STARTFILE_MVME_SPEC },                  \
   { "startfile_sim",           STARTFILE_SIM_SPEC },                   \
   { "startfile_freebsd",       STARTFILE_FREEBSD_SPEC },               \
+  { "startfile_gnu",           STARTFILE_GNU_SPEC },                   \
   { "startfile_linux",         STARTFILE_LINUX_SPEC },                 \
   { "startfile_netbsd",                STARTFILE_NETBSD_SPEC },                \
   { "startfile_vxworks",       STARTFILE_VXWORKS_SPEC },               \
+  { "startfile_windiss",        STARTFILE_WINDISS_SPEC },               \
   { "startfile_default",       STARTFILE_DEFAULT_SPEC },               \
   { "endfile_ads",             ENDFILE_ADS_SPEC },                     \
   { "endfile_yellowknife",     ENDFILE_YELLOWKNIFE_SPEC },             \
   { "endfile_mvme",            ENDFILE_MVME_SPEC },                    \
   { "endfile_sim",             ENDFILE_SIM_SPEC },                     \
   { "endfile_freebsd",         ENDFILE_FREEBSD_SPEC },                 \
+  { "endfile_gnu",             ENDFILE_GNU_SPEC },                     \
   { "endfile_linux",           ENDFILE_LINUX_SPEC },                   \
   { "endfile_netbsd",          ENDFILE_NETBSD_SPEC },                  \
   { "endfile_vxworks",         ENDFILE_VXWORKS_SPEC },                 \
+  { "endfile_windiss",          ENDFILE_WINDISS_SPEC },                 \
   { "endfile_default",         ENDFILE_DEFAULT_SPEC },                 \
   { "link_path",               LINK_PATH_SPEC },                       \
   { "link_shlib",              LINK_SHLIB_SPEC },                      \
@@ -1367,9 +1348,11 @@ ncrtn.o%s"
   { "link_start_mvme",         LINK_START_MVME_SPEC },                 \
   { "link_start_sim",          LINK_START_SIM_SPEC },                  \
   { "link_start_freebsd",      LINK_START_FREEBSD_SPEC },              \
+  { "link_start_gnu",          LINK_START_GNU_SPEC },                  \
   { "link_start_linux",                LINK_START_LINUX_SPEC },                \
   { "link_start_netbsd",       LINK_START_NETBSD_SPEC },               \
   { "link_start_vxworks",      LINK_START_VXWORKS_SPEC },              \
+  { "link_start_windiss",      LINK_START_WINDISS_SPEC },              \
   { "link_start_default",      LINK_START_DEFAULT_SPEC },              \
   { "link_os",                 LINK_OS_SPEC },                         \
   { "link_os_ads",             LINK_OS_ADS_SPEC },                     \
@@ -1378,24 +1361,24 @@ ncrtn.o%s"
   { "link_os_sim",             LINK_OS_SIM_SPEC },                     \
   { "link_os_freebsd",         LINK_OS_FREEBSD_SPEC },                 \
   { "link_os_linux",           LINK_OS_LINUX_SPEC },                   \
+  { "link_os_gnu",             LINK_OS_GNU_SPEC },                     \
   { "link_os_netbsd",          LINK_OS_NETBSD_SPEC },                  \
   { "link_os_vxworks",         LINK_OS_VXWORKS_SPEC },                 \
+  { "link_os_windiss",         LINK_OS_WINDISS_SPEC },                 \
   { "link_os_default",         LINK_OS_DEFAULT_SPEC },                 \
   { "cc1_endian_big",          CC1_ENDIAN_BIG_SPEC },                  \
   { "cc1_endian_little",       CC1_ENDIAN_LITTLE_SPEC },               \
   { "cc1_endian_default",      CC1_ENDIAN_DEFAULT_SPEC },              \
-  { "cpp_endian_big",          CPP_ENDIAN_BIG_SPEC },                  \
-  { "cpp_endian_little",       CPP_ENDIAN_LITTLE_SPEC },               \
-  { "cpp_float_default",       CPP_FLOAT_DEFAULT_SPEC },               \
-  { "cpp_longdouble_default",  CPP_LONGDOUBLE_DEFAULT_SPEC },          \
   { "cpp_os_ads",              CPP_OS_ADS_SPEC },                      \
   { "cpp_os_yellowknife",      CPP_OS_YELLOWKNIFE_SPEC },              \
   { "cpp_os_mvme",             CPP_OS_MVME_SPEC },                     \
   { "cpp_os_sim",              CPP_OS_SIM_SPEC },                      \
   { "cpp_os_freebsd",          CPP_OS_FREEBSD_SPEC },                  \
+  { "cpp_os_gnu",              CPP_OS_GNU_SPEC },                      \
   { "cpp_os_linux",            CPP_OS_LINUX_SPEC },                    \
   { "cpp_os_netbsd",           CPP_OS_NETBSD_SPEC },                   \
   { "cpp_os_vxworks",          CPP_OS_VXWORKS_SPEC },                  \
+  { "cpp_os_windiss",           CPP_OS_WINDISS_SPEC },                  \
   { "cpp_os_default",          CPP_OS_DEFAULT_SPEC },
 
 /* Define this macro as a C expression for the initializer of an
@@ -1497,3 +1480,6 @@ ncrtn.o%s"
 #define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
 
 #define DOUBLE_INT_ASM_OP "\t.quad\t"
+
+/* Generate entries in .fixup for relocatable addresses.  */
+#define RELOCATABLE_NEEDS_FIXUP