summaryrefslogtreecommitdiff
path: root/libexec/ld.so/library.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2005-09-26 14:51:06 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2005-09-26 14:51:06 +0000
commit470bb05f895ae1bafade84565e1ec7c548899be7 (patch)
tree405fc5ea07a951f32d2b89345c5102b6e5de075e /libexec/ld.so/library.c
parent22c76a4323dc7f0d1e6ce13a2dc9317f028cba1a (diff)
Fully unload dependant libraries, fixes gphoto2 bug.
Diffstat (limited to 'libexec/ld.so/library.c')
-rw-r--r--libexec/ld.so/library.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/ld.so/library.c b/libexec/ld.so/library.c
index 5a53c8bce31..38e2390a5e3 100644
--- a/libexec/ld.so/library.c
+++ b/libexec/ld.so/library.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library.c,v 1.41 2005/09/16 23:19:41 drahn Exp $ */
+/* $OpenBSD: library.c,v 1.42 2005/09/26 14:51:05 drahn Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -57,7 +57,12 @@ _dl_load_list_free(struct load_list *load_list)
void
_dl_unload_shlib(elf_object_t *object)
{
+ struct dep_node *n;
+ DL_DEB(("unload_shlib called on %s\n", object->load_name));
if (object->refcount == 0) {
+ TAILQ_FOREACH(n, &object->child_list, next_sib)
+ _dl_unload_shlib(n->data);
+ DL_DEB(("unload_shlib unloading on %s\n", object->load_name));
_dl_load_list_free(object->load_list);
_dl_munmap((void *)object->load_addr, object->load_size);
_dl_remove_object(object);