From 4b12e93df87d277dd252b39c364953502615a35d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 26 Mar 2012 09:35:18 +0000 Subject: vms.h (LINK_SPEC): Simplify. libgcc/ 2012-03-26 Tristan Gingold * config/alpha/vms.h (LINK_SPEC): Simplify. (STARTFILE_SPEC): Remove -mvms-return-codes handling. (NAME__MAIN, SYMBOL__MAIN): Remove. (VMS_DEBUG_MAIN_POINTER): Remove. * config/ia64/vms.h: Likewise. * config/alpha/alpha.c (alpha_start_function): Move vms_debug_main code to vms.c. Call vms_start_function. * config/ia64/ia64.c (ia64_start_function): Likewise. * config/vms/vms-protos.h (vms_start_function): Declare. * config/vms/vms.c (vms_start_function): New function. * config/vms/vms.h (MATH_LIBRARY): Define. (VMS_DEBUG_MAIN_POINTER): Define. gcc/ 2012-03-26 Tristan Gingold * config/alpha/vms.h (LINK_SPEC): Simplify. (STARTFILE_SPEC): Remove -mvms-return-codes handling. (NAME__MAIN, SYMBOL__MAIN): Remove. (VMS_DEBUG_MAIN_POINTER): Remove. * config/ia64/vms.h: Likewise. * config/alpha/alpha.c (alpha_start_function): Move vms_debug_main code to vms.c. Call vms_start_function. * config/ia64/ia64.c (ia64_start_function): Likewise. * config/vms/vms-protos.h (vms_start_function): Declare. * config/vms/vms.c (vms_start_function): New function. * config/vms/vms.h (MATH_LIBRARY): Define. (VMS_DEBUG_MAIN_POINTER): Define. From-SVN: r185791 --- gcc/config/vms/vms.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'gcc/config/vms/vms.c') diff --git a/gcc/config/vms/vms.c b/gcc/config/vms/vms.c index 4a7386f..a85fb3f 100644 --- a/gcc/config/vms/vms.c +++ b/gcc/config/vms/vms.c @@ -23,8 +23,9 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tree.h" #include "vms-protos.h" -#include "tm.h" #include "ggc.h" +#include "target.h" +#include "output.h" /* Correlation of standard CRTL names with DECCRTL function names. */ @@ -194,4 +195,43 @@ vms_function_section (tree decl ATTRIBUTE_UNUSED, return NULL; } +/* Additionnal VMS specific code for start_function. */ + +/* Must be kept in sync with libgcc/config/vms/vms-ucrt0.c */ +#define VMS_MAIN_FLAGS_SYMBOL "__gcc_main_flags" +#define MAIN_FLAG_64BIT (1 << 0) +#define MAIN_FLAG_POSIX (1 << 1) + +void +vms_start_function (const char *fnname) +{ +#if VMS_DEBUGGING_INFO + if (vms_debug_main + && debug_info_level > DINFO_LEVEL_NONE + && strncmp (vms_debug_main, fnname, strlen (vms_debug_main)) == 0) + { + targetm.asm_out.globalize_label (asm_out_file, VMS_DEBUG_MAIN_POINTER); + ASM_OUTPUT_DEF (asm_out_file, VMS_DEBUG_MAIN_POINTER, fnname); + dwarf2out_vms_debug_main_pointer (); + vms_debug_main = 0; + } +#endif + + /* Registers flags used for function main. This is necessary for + crt0 code. */ + if (strcmp (fnname, "main") == 0) + { + unsigned int flags = 0; + + if (flag_vms_pointer_size == VMS_POINTER_SIZE_64) + flags |= MAIN_FLAG_64BIT; + if (!flag_vms_return_codes) + flags |= MAIN_FLAG_POSIX; + + targetm.asm_out.globalize_label (asm_out_file, VMS_MAIN_FLAGS_SYMBOL); + assemble_name (asm_out_file, VMS_MAIN_FLAGS_SYMBOL); + fprintf (asm_out_file, " = %u\n", flags); + } +} + #include "gt-vms.h" -- cgit v1.1