e5678be828
functions are used for destructors of thread_local objects. If a pending destructor exists, prevent unloading of shared objects. Introduce __dl_cxa_refcount interface for this purpose. When the last reference is gone and the object has been dlclose'd before, the unloading is finalized. Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists on providing __cxa_thread_atexit as direct wrapper without further patching.