aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/vms
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2012-03-26 09:35:18 +0000
committerTristan Gingold <gingold@gcc.gnu.org>2012-03-26 09:35:18 +0000
commit4b12e93df87d277dd252b39c364953502615a35d (patch)
treea973198f8cc041f46894699052afb7913081bb3a /gcc/config/vms
parentdb9f46a92723506a064fba0b58e27fd1c2f1a1d8 (diff)
downloadgcc-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')
-rw-r--r--gcc/config/vms/vms-protos.h1
-rw-r--r--gcc/config/vms/vms.c42
-rw-r--r--gcc/config/vms/vms.h7
3 files changed, 48 insertions, 2 deletions
diff --git a/gcc/config/vms/vms-protos.h b/gcc/config/vms/vms-protos.h
index ff97c31..dcff824 100644
--- a/gcc/config/vms/vms-protos.h
+++ b/gcc/config/vms/vms-protos.h
@@ -31,4 +31,5 @@ extern section *vms_function_section (tree decl ATTRIBUTE_UNUSED,
enum node_frequency freq ATTRIBUTE_UNUSED,
bool startup ATTRIBUTE_UNUSED,
bool exit ATTRIBUTE_UNUSED);
+extern void vms_start_function (const char *fname);
#endif /* TREE_CODE */
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"
diff --git a/gcc/config/vms/vms.h b/gcc/config/vms/vms.h
index 47028c8..8eb5606 100644
--- a/gcc/config/vms/vms.h
+++ b/gcc/config/vms/vms.h
@@ -75,10 +75,15 @@ extern void vms_c_register_includes (const char *, const char *, int);
#define C_COMMON_OVERRIDE_OPTIONS vms_c_common_override_options ()
/* VMS doesn't support other sections than .text for code. */
-
#define TARGET_ASM_FUNCTION_SECTION vms_function_section
/* Always use 8 bytes addresses in dwarf2 debug info. The default value doesn't
work as it may be 4 bytes, which won't match gas default (8 bytes for ia64),
and will thus produce incorrect values. */
#define DWARF2_ADDR_SIZE 8
+
+/* No libm on VMS. */
+#define MATH_LIBRARY ""
+
+/* Special VMS debugger symbol to record the entry point. */
+#define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"