This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[VxWorks] Define SUPPORTS_INIT_PRIORITY
- From: Richard Sandiford <richard at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: nathan at codesourcery dot com
- Date: Fri, 16 Mar 2007 14:21:30 +0000
- Subject: [VxWorks] Define SUPPORTS_INIT_PRIORITY
On VxWorks, prioritised constructors and destructors are only supported
for RTPs. They are not supported by kernel mode, which does not use
.ctors or .dtors sections.
Tested on i586-wrs-vxworks, where it fixes the gcc.dg/initpri1.c failure.
OK to install?
Richard
gcc/
* config/vxworks.h (SUPPORTS_INIT_PRIORITY): Define.
Index: gcc/config/vxworks.h
===================================================================
--- gcc/config/vxworks.h (revision 122984)
+++ gcc/config/vxworks.h (working copy)
@@ -87,6 +87,10 @@ #define VXWORKS_ENDFILE_SPEC ""
#define VXWORKS_OVERRIDE_OPTIONS vxworks_override_options ()
extern void vxworks_override_options (void);
+/* Only RTPs support prioritized constructors and destructors:
+ the implementation relies on numbered .ctors* sections. */
+#define SUPPORTS_INIT_PRIORITY TARGET_VXWORKS_RTP
+
/* VxWorks requires special handling of constructors and destructors.
All VxWorks configurations must use these functions. */
#define TARGET_ASM_CONSTRUCTOR vxworks_asm_out_constructor