Patchwork [committed] VMS: always default to .text section

login
register
mail settings
Submitter Tristan Gingold
Date Dec. 21, 2011, 9:48 a.m.
Message ID <816DE467-AE45-40DF-A737-23F99851F0E8@adacore.com>
Download mbox | patch
Permalink /patch/132607/
State New
Headers show

Comments

Tristan Gingold - Dec. 21, 2011, 9:48 a.m.
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  <gingold@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.

Patch

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