From 6805ef53cac4b69d0ff3659c7415fcfb3e577dc4 Mon Sep 17 00:00:00 2001 From: Klaus Kaempf Date: Tue, 9 Jun 1998 12:12:13 +0000 Subject: [PATCH] vms.h (EXTRA_SECTIONS): Add in_ctors and in_dtors. * 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 | 6 ++++++ gcc/config/alpha/vms.h | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 65bd3f606aa..22ae6658b28 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 * haifa-sched.c (update_flow_info): Use UNITS_PER_WORD, not MOVE_MAX, diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index a10b2f060a0..2909af6e7b2 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -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 (); -- 2.30.2