1 // lib/ctors.cc -- Run C++ global constructors
3 // Destructors are not run at shutdown, as we won't be relying on global
4 // destructors to do any cleanup. Constuctors are needed even if we don't
5 // explicitly use them, however, as GCC sometimes uses them implicitly
6 // to initialize global data.
10 #include <lowlevel/barriers.h>
14 typedef void (*ctor)();
17 for (ctor *ptr = &ctors; *ptr; ptr++)
21 // Global constructors call this to register global destructors
22 // with some versions and/or configurations of GCC. I'm not sure
23 // why just using a static dtor table isn't good enough.
25 extern "C" int __cxa_atexit(void (*func)(void *), void *arg, void *d)
30 // More crap we don't care about (we don't use global destructors),