From patchwork Wed Dec 21 09:48:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [committed] VMS: always default to .text section Date: Tue, 20 Dec 2011 23:48:12 -0000 From: Tristan Gingold X-Patchwork-Id: 132607 Message-Id: <816DE467-AE45-40DF-A737-23F99851F0E8@adacore.com> To: GCC Patches 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 * 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