.__init section is ignored, which is unfortunate because it allows running static initialization functions. For example, this enables the C attribute
__attribute__((constructor)), and it also enables some of the missing C++ functionality.
There's a simple fix, which is to call the
.__init section as a function the first time the C API handler is invoked. I've implemented this in setup.c, although there are other variations of how it could be implemented instead.
It would also be very nice to add these linker map lines (
exidx), which allow C++ to use exceptions. Without this change, compiling on C++ throws linker errors.