committed: part of ada support for exception on vxworks

Arnaud Charlet charlet@aix.act-europe.fr
Mon Oct 4 15:17:00 GMT 2004


Tested on ppc-vxworks

Part of zero cost exception support for ppc-vxworks

2004-10-04  Olivier Hainque  <hainque@act-europe.fr>

	* init.c (__gnat_initialize): Call an Ada subprogram to perform the
	table registration calls when need be. Ensures no reference to the crt
	ctors symbol are issued in the SJLJ case, which avoids possible
	undefined symbol errors in the case of modules to be statically linked
	with the kernel.
-------------- next part --------------
Index: init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/init.c,v
retrieving revision 1.37
diff -u -p -r1.37 init.c
--- init.c	13 Sep 2004 10:18:40 -0000	1.37
+++ init.c	4 Oct 2004 14:32:11 -0000
@@ -1850,11 +1850,19 @@ __gnat_initialize (void)
 
 #if DWARF2_UNWIND_INFO && defined (_ARCH_PPC)
  {
-   extern const int __module_has_ctors;
-   extern void __do_global_ctors ();
+   /* The scheme described above is only useful for the actual ZCX case, and
+      we don't want any reference to the crt provided symbols otherwise.  We
+      may not link with any of the crt objects in the non-ZCX case, e.g. from
+      documented procedures instructing the use of -nostdlib, and references
+      to the ctors symbols here would just remain unsatisfied.
+
+      We have no way to avoid those references in the right conditions in this
+      C module, because we have nothing like a IN_ZCX_RTS macro.  This aspect
+      is then deferred to an Ada routine, which can do that based on a test
+      against a constant System flag value.  */
 
-   if (! __module_has_ctors)
-     __do_global_ctors ();
+   extern void __gnat_vxw_setup_for_eh (void);
+   __gnat_vxw_setup_for_eh ();
  }
 #endif
 }


More information about the Gcc-patches mailing list