Exception handling internals

On modern Linux systems an optimization was made to the GNU binary toolchain (the gcc, binutils, glibc triple) to eliminate the relocations the dynamic linker needed to make when loading C libraries which exceptions could propagate through but that did not actually throw and catch exceptions themselves.

The code to perform exception propagation is unfortunately a bit of a mess and parts are duplicated between glibc and gcc3. The key functions are __register_frame_info and __register_frame_info_bases . These functions deal with the internals of throwing exceptions across shared library boundaries.

By default if your systems copy of "ld", the compile time linker, supports the mostly undocumented --eh-frame-hdr option, gcc will optimize away the link in order to improve startup time. Unfortunately while doing so it delegates the exception handling code to glibc rather than libgcc and as such your code gains a dependency on glibc which is much harder to upgrade than libgcc. So, apbuild gives --shared-libgcc to gcc which means it will always be a separate library. When nobody uses pre gcc3 systems anymore we can remove this, but for now it is required.