vms.h (EXTRA_SECTIONS): Add in_ctors and in_dtors.
authorKlaus Kaempf <kkaempf@progis.de>
Tue, 9 Jun 1998 12:12:13 +0000 (12:12 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 9 Jun 1998 12:12:13 +0000 (05:12 -0700)
        * alpha/vms.h (EXTRA_SECTIONS): Add in_ctors and in_dtors.
        (EXTRA_SECTION_FUNCTIONS): Add ctors_section and dtors_section.
        (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Define.

From-SVN: r20376

gcc/ChangeLog
gcc/config/alpha/vms.h

index 65bd3f606aa888029cb800adcf6f756af9599594..22ae6658b2885e215c13810d5e5d1b8c2fca329e 100644 (file)
@@ -1,3 +1,9 @@
+Tue Jun  9 12:12:34 1998  Klaus Kaempf (kkaempf@progis.de)
+
+       * alpha/vms.h (EXTRA_SECTIONS): Add in_ctors and in_dtors.
+       (EXTRA_SECTION_FUNCTIONS): Add ctors_section and dtors_section.       
+       (ASM_OUTPUT_CONSTRUCTOR, ASM_OUTPUT_DESTRUCTOR): Define.                
+
 Tue Jun  9 12:10:27 1998  John Carr  <jfc@mit.edu>
 
         * haifa-sched.c (update_flow_info): Use UNITS_PER_WORD, not MOVE_MAX,
index a10b2f060a0a87c167549badaf6cd85c2a4f923b..2909af6e7b221c46dfa80b1f46cf0a24bf6d5678 100644 (file)
@@ -289,9 +289,11 @@ extern struct rtx_def *alpha_arg_info_reg_val ();
 #define LINK_SECTION_ASM_OP ".link"
 #define READONLY_SECTION_ASM_OP ".rdata"
 #define LITERALS_SECTION_ASM_OP ".literals"
+#define CTORS_SECTION_ASM_OP ".ctors"
+#define DTORS_SECTION_ASM_OP ".dtors"
 
 #undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_link, in_rdata, in_literals
+#define EXTRA_SECTIONS in_link, in_rdata, in_literals, in_ctors, in_dtors
 
 #undef EXTRA_SECTION_FUNCTIONS
 #define EXTRA_SECTION_FUNCTIONS                                        \
@@ -321,6 +323,24 @@ literals_section ()                                                \
       fprintf (asm_out_file, "%s\n", LITERALS_SECTION_ASM_OP);         \
       in_section = in_literals;                                        \
     }                                                          \
+}                                                              \
+void                                                           \
+ctors_section ()                                               \
+{                                                              \
+  if (in_section != in_ctors)                                  \
+    {                                                          \
+      fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);    \
+      in_section = in_ctors;                                   \
+    }                                                          \
+}                                                              \
+void                                                           \
+dtors_section ()                                               \
+{                                                              \
+  if (in_section != in_dtors)                                  \
+    {                                                          \
+      fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);    \
+      in_section = in_dtors;                                   \
+    }                                                          \
 }
 
 #undef ASM_OUTPUT_ADDR_DIFF_ELT
@@ -399,6 +419,26 @@ do {                                                                       \
 
 #undef TRANSFER_FROM_TRAMPOLINE
 
+/* 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.quad ");                        \
+    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.quad ");                        \
+    assemble_name (FILE, NAME);                        \
+    fprintf (FILE, "\n");                              \
+  } while (0)
+
 #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
   (vms_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
 extern int vms_valid_decl_attribute_p ();