diff options
Diffstat (limited to 'gcc/config/vms/vms.c')
-rw-r--r-- | gcc/config/vms/vms.c | 42 |
1 files changed, 41 insertions, 1 deletions
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" |