diff options
author | Tristan Gingold <gingold@adacore.com> | 2012-03-26 09:35:18 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@gcc.gnu.org> | 2012-03-26 09:35:18 +0000 |
commit | 4b12e93df87d277dd252b39c364953502615a35d (patch) | |
tree | a973198f8cc041f46894699052afb7913081bb3a /gcc/config/vms/vms.c | |
parent | db9f46a92723506a064fba0b58e27fd1c2f1a1d8 (diff) | |
download | gcc-4b12e93df87d277dd252b39c364953502615a35d.zip gcc-4b12e93df87d277dd252b39c364953502615a35d.tar.gz gcc-4b12e93df87d277dd252b39c364953502615a35d.tar.bz2 |
vms.h (LINK_SPEC): Simplify.
libgcc/
2012-03-26 Tristan Gingold <gingold@adacore.com>
* 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 <gingold@adacore.com>
* 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
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" |