aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i960
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>1995-03-01 19:54:01 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>1995-03-01 19:54:01 +0000
commit2038d7efaa2752871497ca4ee85043d9c4356c73 (patch)
treecc1ffe4190c5512eee7b997941acda8a246320ee /gcc/config/i960
parentbb68ff55b181ac17df6a274b3171876a121fad9d (diff)
downloadgcc-2038d7efaa2752871497ca4ee85043d9c4356c73.zip
gcc-2038d7efaa2752871497ca4ee85043d9c4356c73.tar.gz
gcc-2038d7efaa2752871497ca4ee85043d9c4356c73.tar.bz2
Add support for COFF style constructors
From-SVN: r9101
Diffstat (limited to 'gcc/config/i960')
-rw-r--r--gcc/config/i960/i960-coff.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/gcc/config/i960/i960-coff.h b/gcc/config/i960/i960-coff.h
index 20c6126..50f78c5 100644
--- a/gcc/config/i960/i960-coff.h
+++ b/gcc/config/i960/i960-coff.h
@@ -29,4 +29,70 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
+#undef ASM_FILE_START
+#define ASM_FILE_START(FILE) \
+ output_file_directive ((FILE), main_input_filename)
+
+/* Support the ctors and dtors sections for g++. */
+
+#define CTORS_SECTION_ASM_OP ".section\t.ctors,\"x\""
+#define DTORS_SECTION_ASM_OP ".section\t.dtors,\"x\""
+
+/* A list of other sections which the compiler might be "in" at any
+ given time. */
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_ctors, in_dtors
+
+/* A list of extra section function definitions. */
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CTORS_SECTION_FUNCTION \
+ DTORS_SECTION_FUNCTION
+
+#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; \
+ } \
+}
+
+#define INT_ASM_OP ".word"
+
+/* A C statement (sans semicolon) to output an element in the table of
+ global constructors. */
+#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)
+
/* end of i960-coff.h */