summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-08 17:51:16 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-08 17:51:16 +0000
commitd0c48d4a7fbb39a7a4c91b833eb3d4f5ab7ba389 (patch)
treef9e14e8ee0f9f1ef1e6c9f365470e50e5d5ad2d3
parentd3690d81d2b33a0b58f3ad5b91b96fa9e57b57c6 (diff)
For some perverse reason we were not registering destructors
for dlopen'd libraries. This fixes that. -Erik
-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