Initial revision
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 10 Feb 1996 13:27:49 +0000 (08:27 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 10 Feb 1996 13:27:49 +0000 (08:27 -0500)
From-SVN: r11196

gcc/config/m68k/m68k-psos.h [new file with mode: 0644]
gcc/config/psos.h [new file with mode: 0644]

diff --git a/gcc/config/m68k/m68k-psos.h b/gcc/config/m68k/m68k-psos.h
new file mode 100644 (file)
index 0000000..d775c6e
--- /dev/null
@@ -0,0 +1,67 @@
+/* Definitions of a target machine for the GNU compiler:
+   68040 running pSOS, ELF object files, DBX debugging.
+   Copyright (C) 1996 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+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, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/* Use MOTOROLA assembler syntax, as gas is configured that way and
+   glibc also seems to use it. Must come BEFORE m68k.h! */
+
+#define MOTOROLA
+
+/* Get generic m68k definitions. */
+
+#include "m68k/m68k.h"
+#include "m68k/m68kemb.h"
+
+/* Default processor type is a (pure) 68040 with 68881 emulation using
+   the floating-point support package. */
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT 01007
+
+/* Options passed to CPP, GAS, CC1 and CC1PLUS. We override
+   m68k-none.h for consistency with TARGET_DEFAULT. */
+
+#undef CPP_SPEC
+#define CPP_SPEC \
+"%{!mc68000:%{!m68000:%{!m68332:%{!msoft-float:-D__HAVE_68881__ }}}}\
+%{!ansi:-Dmc68000 %{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68302:-Dmc68302 }%{m68332:-Dmc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-Dmc68040 }}}}}}}}}}}\
+-D__mc68000__ -D__mc68000 %{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 }%{m68302:-D__mc68302__ -D__mc68302 }%{m68332:-D__mc68332__ -D__mc68332 }%{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-D__mc68040__ -D__mc68040 }}}}}}}}}}"
+
+#undef ASM_SPEC
+#define ASM_SPEC \
+"%{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881 }\
+%{m68000}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040}%{m68302}%{m68332}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-mc68040}}}}}}}}}}"
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+ "%{m68000:%{!m68881:-msoft-float }}%{m68302:-m68000}%{m68332:-m68020 -mnobitfield %{!m68881:-msoft-float}}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-m68040}}}}}}}}}}"
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC \
+ "%{m68000:%{!m68881:-msoft-float }}%{m68302:-m68000}%{m68332:-m68020 -mnobitfield %{!m68881:-msoft-float}}%{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:-m68040}}}}}}}}}}"
+
+
+/* Get processor-independent pSOS definitions. */
+
+#include "psos.h"
+
+
+/* end of m68k-psos.h */
diff --git a/gcc/config/psos.h b/gcc/config/psos.h
new file mode 100644 (file)
index 0000000..0299a35
--- /dev/null
@@ -0,0 +1,183 @@
+/* Operating system specific defines to be used when targeting GCC for some
+   embedded system running pSOS. We assume GNU tools with ELF, but
+   try to maintain compatibility with the MRI tools. Based on svr4.h.
+   Copyright (C) 1996 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+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, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+   To use this file, make up a file with a name like:
+
+       ?????-psos.h
+
+   where ????? is replaced by the name of the basic hardware that you
+   are targeting for.  Then, in the file ?????-psos.h, put something
+   like:
+
+       #include "?????.h"
+       #include "psos.h"
+
+   followed by any really system-specific defines (or overrides of
+   defines) which you find that you need.
+*/
+
+
+/* Define a symbol indicating that we are using psos.h.  */
+
+#define USING_PSOS_H
+
+
+/* All pSOS targets currently use the ELF object file format.  */
+
+#define OBJECT_FORMAT_ELF
+
+
+/* Provide a NULL STARTFILE_SPEC. The startfile cannot be specified
+   here because it depends on the architecture (e.g. 68K), the
+   board-support package (e.g. M162) and the run-time configuration
+   (e.g. application vs. ram-image vs. rom-image). Specify the
+   startfile in a linker-script created from the generic
+   architecture-specific linker-scripts. */
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC ""
+
+
+/* Predefined macros (independent of processor type). */
+
+#define CPP_PREDEFINES "-Dpsos"
+
+
+/* Implicit library calls should use ANSI memcpy rather than BSD
+   bcopy, etc.  */
+
+#define TARGET_MEM_FUNCTIONS
+
+
+/* When using stabs, gcc2_compiled must be a stabs entry, not an
+   ordinary symbol, or gdb won't see it.  The stabs entry must be
+   before the N_SO in order for gdb to find it.  */
+
+#define ASM_IDENTIFY_GCC(FILE)                                         \
+do                                                                     \
+  {                                                                    \
+    fputs (".stabs \"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE);        \
+  }                                                                    \
+while (0)
+
+/* This is how we tell the assembler that a symbol is weak.  */
+
+#define ASM_WEAKEN_LABEL(FILE,NAME) \
+  do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
+       fputc ('\n', FILE); } while (0)
+
+/* Switch into a generic section. */
+
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
+  fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
+          (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
+          (DECL) && TREE_READONLY (DECL) ? "a" : "aw")
+
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors
+   sections. */
+
+#define CTORS_SECTION_ASM_OP   ".section\t.ctors,\"aw\""
+#define DTORS_SECTION_ASM_OP   ".section\t.dtors,\"aw\""
+
+/* A default list of other sections which we might be "in" at any given
+   time.  For targets that use additional sections (e.g. .tdesc) you
+   should override this definition in the target-specific file which
+   includes this file.  */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_ctors, in_dtors
+
+/* A default list of extra section function definitions.  For targets
+   that use additional sections (e.g. .tdesc) you should override this
+   definition in the target-specific file which includes this file.  */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS                                                \
+  CTORS_SECTION_FUNCTION                                               \
+  DTORS_SECTION_FUNCTION
+
+extern void text_section ();
+
+#define CTORS_SECTION_FUNCTION                                         \
+void                                                                   \
+ctors_section ()                                                       \
+{                                                                      \
+  if (in_section != in_ctors)                                          \
+    {                                                                  \
+      fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);            \
+      in_section = in_ctors;                                           \
+    }                                                                  \
+}
+
+#define DTORS_SECTION_FUNCTION                                         \
+void                                                                   \
+dtors_section ()                                                       \
+{                                                                      \
+  if (in_section != in_dtors)                                          \
+    {                                                                  \
+      fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);            \
+      in_section = in_dtors;                                           \
+    }                                                                  \
+}
+
+/* A C statement (sans semicolon) to output an element in the table of
+   global constructors.  */
+
+#ifndef INT_ASM_OP
+#define INT_ASM_OP             ".long"
+#endif
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                              \
+  do {                                                                 \
+    ctors_section ();                                                  \
+    fprintf (FILE, "\t%s\t ", INT_ASM_OP);                             \
+    assemble_name (FILE, NAME);                                                \
+    fprintf (FILE, "\n");                                              \
+  } while (0)
+
+/* A C statement (sans semicolon) to output an element in the table of
+   global destructors.  */
+
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                                       \
+  do {                                                                 \
+    dtors_section ();                                                  \
+    fprintf (FILE, "\t%s\t ", INT_ASM_OP);                             \
+    assemble_name (FILE, NAME);                                        \
+    fprintf (FILE, "\n");                                              \
+  } while (0)
+
+
+/* Use DBX debugging info by default.  */
+
+#ifndef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#endif
+
+/* For pSOS we use DBX debugging info.  */
+
+#define DBX_DEBUGGING_INFO
+
+
+/* Prevent generation of an exit function.  */
+
+#define HAVE_ATEXIT
+