[llvm-dev] Providing __dso_handle in LLVM

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 2 06:39:53 PDT 2017


On Fri, Jun 02, 2017 at 03:14:17PM +0200, Joerg Sonnenberger via llvm-dev wrote:
> Note that __cxa_atexit is used by the C frontend as well for attribute
> destructor support.

OK, to fully clarify this part: the C frontend doesn't generate any such
calls, but it is the prefered way for shared libraries to hook up
dynamic finalization code. atexit() is broken for this purpose for the
obvious reasons that it doesn't have any specified interaction with
dlclose().

Joerg


More information about the llvm-dev mailing list