This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]