diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2002-03-17 04:50:58 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2002-03-17 04:50:58 +0000 |
commit | 76a0b2b81f310ce5879fbe7e37f7961dcc54aa67 (patch) | |
tree | cebb9b6777c382585186ef1d0a1c769c6f9b99ca | |
parent | 74d0859e395d0c0a1fc2050833f68e182c1220ea (diff) |
Remove hackery I added to deal with dlopen(NULL), handle it in a reasonably
sane manner. This and the previous resolve.c change art@ ok
-rw-r--r-- | libexec/ld.so/dlfcn.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c index 54a90013851..3451600b5a8 100644 --- a/libexec/ld.so/dlfcn.c +++ b/libexec/ld.so/dlfcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dlfcn.c,v 1.13 2002/03/07 00:54:09 art Exp $ */ +/* $OpenBSD: dlfcn.c,v 1.14 2002/03/17 04:50:57 drahn Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -58,7 +58,7 @@ dlopen(const char *libname, int how) Elf_Dyn *dynp; if (libname == NULL) { - return NULL; + return _dl_objects; } DL_DEB(("dlopen: loading: %s\n", libname)); @@ -122,16 +122,6 @@ dlsym(void *handle, const char *name) void *retval; const Elf_Sym *sym = NULL; - if (handle == NULL) { - object = _dl_objects; - retval = (void *)_dl_find_symbol(name, object, &sym, 1, 1); - if (sym != NULL) { - retval += sym->st_value; - } else { - _dl_errno = DL_NO_SYMBOL; - } - return retval; - } object = (elf_object_t *)handle; dynobj = _dl_objects; while (dynobj && dynobj != object) { @@ -175,6 +165,9 @@ dlclose(void *handle) { int retval; + if (handle == _dl_objects) { + return 0; + } retval = _dl_real_close(handle); if (_dl_debug_map->r_brk) { |