Hi,

like the HP-UX linker, the VMS linker doesn't deal well with named text 
sections.
So, always default to .text section on both Alpha and ia64 VMS.

Committed on trunk.

Tristan.

2011-12-21  Tristan Gingold  <ging...@adacore.com>

        * config/vms/vms-protos.h (vms_function_section): New prototype.
        * config/vms/vms.c (vms_function_section): New function.
        * config/vms/vms.h (TARGET_ASM_FUNCTION_SECTION): Define.

Index: gcc/config/vms/vms-protos.h
===================================================================
--- gcc/config/vms/vms-protos.h (revision 182566)
+++ gcc/config/vms/vms-protos.h (working copy)
@@ -22,3 +22,10 @@
 
 /* vms.c  */
 void vms_patch_builtins (void);
+
+#ifdef TREE_CODE
+extern section *vms_function_section (tree decl ATTRIBUTE_UNUSED,
+                                      enum node_frequency freq 
ATTRIBUTE_UNUSED,
+                                      bool startup ATTRIBUTE_UNUSED,
+                                      bool exit ATTRIBUTE_UNUSED);
+#endif /* TREE_CODE */
Index: gcc/config/vms/vms.c
===================================================================
--- gcc/config/vms/vms.c        (revision 182566)
+++ gcc/config/vms/vms.c        (working copy)
@@ -180,4 +180,15 @@
     }
 }
 
+/* Always default to .text section.  */
+
+section *
+vms_function_section (tree decl ATTRIBUTE_UNUSED,
+                      enum node_frequency freq ATTRIBUTE_UNUSED,
+                      bool startup ATTRIBUTE_UNUSED,
+                      bool exit ATTRIBUTE_UNUSED)
+{
+  return NULL;
+}
+
 #include "gt-vms.h"
Index: gcc/config/vms/vms.h
===================================================================
--- gcc/config/vms/vms.h        (revision 182566)
+++ gcc/config/vms/vms.h        (working copy)
@@ -61,3 +61,7 @@
 #define SIZE_TYPE "unsigned int"
 #undef PTRDIFF_TYPE
 #define PTRDIFF_TYPE "int"
+
+/* VMS doesn't support other sections than .text for code.  */
+
+#define TARGET_ASM_FUNCTION_SECTION vms_function_section

Reply via email to