krytarowski added a comment. atexit(3)/NetBSD calls internally __cxa_atexit() and it can be intercepted. Certainly there is some way to support real atexit(3), but it has been disabled explicitly perhaps for the same reason. Repository: rL LLVM https://reviews.llvm.org/D39619