libg++'s exception code causes gcc to generate (ahem!) non-conventional
assembler code in -fpic mode that gas and ld choke on. Basically, gas
and ld require than symbols referenced in the GOT (global offset table)
are actually global (as the name implies). It attempted to work around
it before, but didn't quite go far enough to prevent a core dump in ld.
This hack causes GOT referenced symbols to be forced global. This
probably breaks the __EXCEPTION_TABLE__ stuff in pic mode, but heck, it
wasn't even possible to compile with a shared library before at all.
I'm not 100% sure what the bug is. There's two possibilities:
1: gcc/cp/exception.c has to be fixed to stop doing GOT references to
local symbols, or
2: as/ld/symorder/ld.so etc need to be taught about how to keep local
symbols around so that they can be dealt with in GOT references.
John Polstra's elfkit stuff seems to deal with this fine though, which is
why I think it's a "missing feature" in our hacked gas and ld..