summaryrefslogtreecommitdiff
path: root/libc/stdlib/atexit.c
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-03-20 17:45:03 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-03-20 17:45:03 +0000
commitffd5ef60722c8a7295731cb6f7f54126fd07da3e (patch)
treeb6cf7b6e2d13c1e5f59c6edf0ce728886bfa77b1 /libc/stdlib/atexit.c
parentd028db7898abe3472c9c5f0019d1dfaa14ecbdc2 (diff)
Prepare for moving ldso FINI handling into libc.
#define _DL_DO_FINI_IN_LIBC to enable(the arch specific part needs to be in place first).
Diffstat (limited to 'libc/stdlib/atexit.c')
-rw-r--r--libc/stdlib/atexit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index 082e532fd..d5f83ee8e 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -222,6 +222,7 @@ pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
extern void (*__app_fini)(void);
#endif
+extern void (*__rtld_fini)(void);
/*
* Normal program termination
*/
@@ -238,6 +239,11 @@ void exit(int rv)
if (__app_fini != NULL)
(__app_fini)();
#endif
+#ifdef _DL_DO_FINI_IN_LIBC
+/* arches that has moved their ldso FINI handling should #define _DL_DO_FINI_IN_LIBC */
+ if (__rtld_fini != NULL)
+ (__rtld_fini)();
+#endif
/* If we are using stdio, try to shut it down. At the very least,
* this will attempt to commit all buffered writes. It may also