summaryrefslogtreecommitdiff
path: root/libexec/ld.so/library_mquery.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2005-05-10 03:36:08 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2005-05-10 03:36:08 +0000
commitba63d6cf60afa1d91d7be6764afb5b1f24ff1978 (patch)
tree93b1be5065fbd0e57d61d97a66a0c99e47da6b96 /libexec/ld.so/library_mquery.c
parent045f394f80448de62bdad4a1efa368d3c4e8ca9c (diff)
Recommit the destructor order fix, now that the amd64 bug was fixed.
'no problem' pval@
Diffstat (limited to 'libexec/ld.so/library_mquery.c')
-rw-r--r--libexec/ld.so/library_mquery.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/libexec/ld.so/library_mquery.c b/libexec/ld.so/library_mquery.c
index 86345c02457..300978e4372 100644
--- a/libexec/ld.so/library_mquery.c
+++ b/libexec/ld.so/library_mquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library_mquery.c,v 1.18 2005/04/06 00:16:53 deraadt Exp $ */
+/* $OpenBSD: library_mquery.c,v 1.19 2005/05/10 03:36:07 drahn Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -59,12 +59,27 @@ _dl_load_list_free(struct load_list *load_list)
}
void
+_dl_notify_unload_shlib(elf_object_t *object)
+{
+ struct dep_node *n;
+
+ if (--object->refcount == 0)
+ for (n = object->first_child; n; n = n->next_sibling)
+ _dl_notify_unload_shlib(n->data);
+}
+
+void
_dl_unload_shlib(elf_object_t *object)
{
- if (--object->refcount == 0) {
- _dl_run_dtors(object);
+ struct dep_node *n;
+
+ if (object->refcount == 0) {
_dl_load_list_free(object->load_list);
_dl_remove_object(object);
+
+ for (n = object->first_child; n; n = n->next_sibling) {
+ _dl_unload_shlib(n->data);
+ }
}
}