diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-05-10 03:36:08 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-05-10 03:36:08 +0000 |
commit | ba63d6cf60afa1d91d7be6764afb5b1f24ff1978 (patch) | |
tree | 93b1be5065fbd0e57d61d97a66a0c99e47da6b96 /libexec/ld.so/dlfcn.c | |
parent | 045f394f80448de62bdad4a1efa368d3c4e8ca9c (diff) |
Recommit the destructor order fix, now that the amd64 bug was fixed.
'no problem' pval@
Diffstat (limited to 'libexec/ld.so/dlfcn.c')
-rw-r--r-- | libexec/ld.so/dlfcn.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c index cfa466ee718..1df2329e36b 100644 --- a/libexec/ld.so/dlfcn.c +++ b/libexec/ld.so/dlfcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dlfcn.c,v 1.46 2005/04/06 00:16:53 deraadt Exp $ */ +/* $OpenBSD: dlfcn.c,v 1.47 2005/05/10 03:36:07 drahn Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -40,12 +40,10 @@ int _dl_errno; -static int _dl_real_close(void *handle); -static void _dl_unload_deps(elf_object_t *object); -static void _dl_thread_kern_stop(void); -static void _dl_thread_kern_go(void); -static void (*_dl_thread_fnc)(int) = NULL; -static elf_object_t *obj_from_addr(const void *addr); +int _dl_real_close(void *handle); +void _dl_unload_deps(elf_object_t *object); +void (*_dl_thread_fnc)(int) = NULL; +elf_object_t *obj_from_addr(const void *addr); void * dlopen(const char *libname, int flags) @@ -113,6 +111,9 @@ dlopen(const char *libname, int flags) _dl_rtld(object); _dl_call_init(object); + _dl_link_dlopen(object); + + if (_dl_debug_map->r_brk) { _dl_debug_map->r_state = RT_ADD; (*((void (*)(void))_dl_debug_map->r_brk))(); @@ -229,7 +230,7 @@ dlclose(void *handle) return (retval); } -static int +int _dl_real_close(void *handle) { elf_object_t *object; @@ -250,6 +251,7 @@ _dl_real_close(void *handle) _dl_unload_deps(dynobj); } + _dl_unlink_dlopen(object); _dl_unload_shlib(object); return (0); } @@ -258,7 +260,7 @@ _dl_real_close(void *handle) * Scan through the shadow dep list and 'unload' every library * we depend upon. Shadow objects are removed when removing ourself. */ -static void +void _dl_unload_deps(elf_object_t *object) { elf_object_t *depobj; @@ -379,14 +381,14 @@ _dl_show_objects(void) _dl_symcachestat_lookups)); } -static void +void _dl_thread_kern_stop(void) { if (_dl_thread_fnc != NULL) (*_dl_thread_fnc)(0); } -static void +void _dl_thread_kern_go(void) { if (_dl_thread_fnc != NULL) |