summaryrefslogtreecommitdiff
path: root/libexec/ld.so/library_subr.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-06 00:16:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-06 00:16:54 +0000
commit97b5dbcee340f2c57bc7189ecfe7c93337e29007 (patch)
tree221b9c2493747769edb7397bf5c666ea4a8962de /libexec/ld.so/library_subr.c
parent6119f0701e2a8cb66ce05c15007eb7c8185c117b (diff)
backout -- breaks at least amd64; spotted by marc
Diffstat (limited to 'libexec/ld.so/library_subr.c')
-rw-r--r--libexec/ld.so/library_subr.c85
1 files changed, 1 insertions, 84 deletions
diff --git a/libexec/ld.so/library_subr.c b/libexec/ld.so/library_subr.c
index bd1b2bb85d3..c3e3fef80aa 100644
--- a/libexec/ld.so/library_subr.c
+++ b/libexec/ld.so/library_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library_subr.c,v 1.2 2005/04/05 19:29:09 drahn Exp $ */
+/* $OpenBSD: library_subr.c,v 1.3 2005/04/06 00:16:53 deraadt Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -41,12 +41,6 @@
#define DEFAULT_PATH "/usr/lib"
-static void _dl_unload_dlopen_recurse(struct dep_node *node);
-
-/* STATIC DATA */
-static struct dep_node *_dlopened_first_child;
-static struct dep_node *_dlopened_last_child;
-
/*
* _dl_match_file()
*
@@ -335,83 +329,6 @@ again:
void
-_dl_link_dlopen(elf_object_t *dep)
-{
- struct dep_node *n;
-
- n = _dl_malloc(sizeof *n);
- if (n == NULL)
- _dl_exit(5);
-
- n->data = dep;
- n->next_sibling = NULL;
- if (_dlopened_first_child) {
- _dlopened_last_child->next_sibling = n;
- _dlopened_last_child = n;
- } else
- _dlopened_first_child = _dlopened_last_child = n;
-
- DL_DEB(("linking %s as dlopen()ed\n", dep->load_name));
-}
-
-void
-_dl_unlink_dlopen(elf_object_t *dep)
-{
- struct dep_node **dnode;
- struct dep_node *pnode;
- struct dep_node *next;
-
- dnode = &_dlopened_first_child;
-
- if (_dlopened_first_child == NULL)
- return;
-
- if (_dlopened_first_child->data == dep) {
- next = _dlopened_first_child->next_sibling;
- _dl_free(_dlopened_first_child);
- _dlopened_first_child = next;
- return;
- }
- pnode = _dlopened_first_child;
-
- while (pnode->next_sibling != NULL) {
- if (pnode->next_sibling->data == dep) {
- next = pnode->next_sibling->next_sibling;
- if (pnode->next_sibling == _dlopened_last_child)
- _dlopened_last_child = pnode;
- _dl_free(pnode->next_sibling);
- pnode->next_sibling = next;
- break;
- }
- pnode = pnode->next_sibling;
- }
-}
-
-void
-_dl_unload_dlopen(void)
-{
- if (_dlopened_first_child != NULL)
- _dl_unload_dlopen_recurse(_dlopened_first_child);
-}
-
-/*
- * is recursion here a good thing?
- */
-void
-_dl_unload_dlopen_recurse(struct dep_node *node)
-{
- if (node->next_sibling != NULL) {
- _dl_unload_dlopen_recurse(node->next_sibling);
- }
- _dl_notify_unload_shlib(node->data);
- _dl_run_all_dtors();
- if (_dl_exiting == 0)
- _dl_unload_shlib(node->data);
- _dl_free(node);
-}
-
-
-void
_dl_link_sub(elf_object_t *dep, elf_object_t *p)
{
struct dep_node *n;