]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Craft .ctors/.dtors sections manually for VxWorks EH registration
authorOlivier Hainque <hainque@adacore.com>
Wed, 30 May 2018 08:57:50 +0000 (08:57 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 30 May 2018 08:57:50 +0000 (08:57 +0000)
Temporary change for experimental purposes. Further cleanups will
be needed if this sheme works as we hope.

2018-05-30  Olivier Hainque  <hainque@adacore.com>

gcc/ada/

* 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.

From-SVN: r260938

gcc/ada/ChangeLog
gcc/ada/vx_crtbegin_attr.c

index 1e1056b6fd9a921118482a3c04cb0e41f59b3ce4..7d70d82fd6e54d8b7227ea5a38e38b640420e432 100644 (file)
@@ -1,3 +1,9 @@
+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,
index 19fbe6061bb9ca83784da241f0fddfafebad0711..f10555d21a5d3e857395da1d87b360f8981bc628 100644 (file)
 
 /* 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 };
This page took 0.066989 seconds and 5 git commands to generate.