diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1e1056b6fd9..7d70d82fd6e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2018-05-30 Olivier Hainque + + * 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 * aspects.ads, contracts.adb, exp_util.adb, expander.adb, expander.ads, diff --git a/gcc/ada/vx_crtbegin_attr.c b/gcc/ada/vx_crtbegin_attr.c index 19fbe6061bb..f10555d21a5 100644 --- a/gcc/ada/vx_crtbegin_attr.c +++ b/gcc/ada/vx_crtbegin_attr.c @@ -31,12 +31,19 @@ /* 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 };