Neither MacOS nor Linux nor FreeBSD get this right. All call atexit
during dlclose
.
mulle-make
or
(
mkdir build &&
cd build &&
cmake .. &&
make
)
./build/dlclose ./build/libbar.so
./build/dlclose ./build/libbar.dylib
-> dlopen
void bar(void)
-- install bar_atexit
<- dlclose
void bar_exit(void) <<< TOO EARLY
-- install main_atexit
exit
void main_atexit(void)