summaryrefslogtreecommitdiff
path: root/ldso/libdl/dlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/libdl/dlib.c')
-rw-r--r--ldso/libdl/dlib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ldso/libdl/dlib.c b/ldso/libdl/dlib.c
index 3c1eab43a..d68ff1356 100644
--- a/ldso/libdl/dlib.c
+++ b/ldso/libdl/dlib.c
@@ -225,6 +225,10 @@ void *_dlopen(const char *libname, int flag)
dl_elf_init = (int (*)(void)) (tpnt->loadaddr + tpnt->dynamic_info[DT_INIT]);
(*dl_elf_init) ();
}
+ if (tpnt->dynamic_info[DT_FINI]) {
+ atexit((void (*)(void)) (tpnt->loadaddr + tpnt->dynamic_info[DT_FINI]));
+ }
+
}
#ifdef USE_CACHE