summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldso/libdl/dlib.c4
-rw-r--r--ldso/libdl/libdl.c4
2 files changed, 8 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
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 3c1eab43a..d68ff1356 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.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