aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2018-05-30 08:57:50 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-30 08:57:50 +0000
commit5e648d3021c10f8bc1fcc3404dcd5ede6cdc32f9 (patch)
treed88c603d13e454f7b08e2976b8c9767ff5f92fa0 /gcc
parent812e6118dcab9e0b0e717c44a987ce65ec7c13ec (diff)
downloadgcc-5e648d3021c10f8bc1fcc3404dcd5ede6cdc32f9.zip
gcc-5e648d3021c10f8bc1fcc3404dcd5ede6cdc32f9.tar.gz
gcc-5e648d3021c10f8bc1fcc3404dcd5ede6cdc32f9.tar.bz2
[Ada] Craft .ctors/.dtors sections manually for VxWorks EH registration
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/vx_crtbegin_attr.c17
2 files changed, 18 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1e1056b..7d70d82 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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,
diff --git a/gcc/ada/vx_crtbegin_attr.c b/gcc/ada/vx_crtbegin_attr.c
index 19fbe60..f10555d 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 };