+2018-05-30 Olivier Hainque <hainque@adacore.com>
+
+ * vx_crtbegin_attr.c (CTOR_ATTRIBUTE, DTOR_ATTRIBUTE): Empty.
+ (eh_registration_ctors, eh_registration_tors): New static variables,
+ forced in a .ctors/.dtors section, respectively, with priority.
+
2018-05-30 Bob Duff <duff@adacore.com>
* aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads,
/* crtbegin kind of file for ehframe registration/deregistration
purposes on VxWorks. This variant exposes the ctor/dtor functions
- as explicit constructors, expected to be placed in a .ctors/.dtors
- section. */
+ as explicit constructors referenced from a .ctors/.dtors section. */
+
+#define CTOR_ATTRIBUTE
+#define DTOR_ATTRIBUTE
+
+#include "vx_crtbegin.inc"
/* 101 is the highest user level priority allowed by VxWorks. */
-#define CTOR_ATTRIBUTE __attribute__((constructor(101)))
-#define DTOR_ATTRIBUTE __attribute__((destructor(101)))
+static void (* volatile eh_registration_ctors[])()
+ __attribute__((section (".ctors.65424")))
+= { &CTOR_NAME };
-#include "vx_crtbegin.inc"
+static void (* volatile eh_registration_dtors[])()
+ __attribute__((section (".dtors.65424")))
+= { &DTOR_NAME };