]> gcc.gnu.org Git - gcc.git/commitdiff
Add support for coff-based ctor/dtor handling.
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 29 Oct 1993 15:49:33 +0000 (11:49 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 29 Oct 1993 15:49:33 +0000 (11:49 -0400)
From-SVN: r5929

gcc/config/i386/go32.h

index a7c903998f0e40738766aa09a7692ac5dc94ba90..910bc7da24a1accbc69c6181a9171a7a448179fe 100644 (file)
@@ -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)
+
+
This page took 0.06583 seconds and 5 git commands to generate.