aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-10-29 11:49:33 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-10-29 11:49:33 -0400
commit66168f5d32b3703c999833307b14eb4729fc4139 (patch)
treec4a0de0779a0c77d2761bcb288a3a223642620f5 /gcc
parentc192da272be503d6d70ee09165cbac6de7b0b88a (diff)
downloadgcc-66168f5d32b3703c999833307b14eb4729fc4139.zip
gcc-66168f5d32b3703c999833307b14eb4729fc4139.tar.gz
gcc-66168f5d32b3703c999833307b14eb4729fc4139.tar.bz2
Add support for coff-based ctor/dtor handling.
From-SVN: r5929
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/go32.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/gcc/config/i386/go32.h b/gcc/config/i386/go32.h
index a7c9039..910bc7d 100644
--- a/gcc/config/i386/go32.h
+++ b/gcc/config/i386/go32.h
@@ -9,3 +9,51 @@
#endif
#define CPP_PREDEFINES "-Dunix -Di386 -DGO32 -DMSDOS \
-Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386)"
+
+#undef EXTRA_SECTIONS
+#define EXTRA_SECTIONS in_ctor, in_dtor
+
+#undef EXTRA_SECTION_FUNCTIONS
+#define EXTRA_SECTION_FUNCTIONS \
+ CTOR_SECTION_FUNCTION \
+ DTOR_SECTION_FUNCTION
+
+#define CTOR_SECTION_FUNCTION \
+void \
+ctor_section () \
+{ \
+ if (in_section != in_ctor) \
+ { \
+ fprintf (asm_out_file, "\t.section .ctor\n"); \
+ in_section = in_ctor; \
+ } \
+}
+
+#define DTOR_SECTION_FUNCTION \
+void \
+dtor_section () \
+{ \
+ if (in_section != in_dtor) \
+ { \
+ fprintf (asm_out_file, "\t.section .dtor\n"); \
+ in_section = in_dtor; \
+ } \
+}
+
+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
+ do { \
+ ctor_section (); \
+ fprintf (FILE, "%s\t", ASM_LONG); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
+ do { \
+ dtor_section (); \
+ fprintf (FILE, "%s\t", ASM_LONG); \
+ assemble_name (FILE, NAME); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+