diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-06-28 15:52:36 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-06-28 15:52:36 +0000 |
commit | b3fc5f84d13573b9494fb1f0db9b5e80679e5098 (patch) | |
tree | dc0a71f8e940437cbc744a1b2fb9e8a01913a5a8 /nss | |
parent | 738d1a5a43e97ee81d7b62a3c7a5f754f5b51b82 (diff) | |
download | glibc-b3fc5f84d13573b9494fb1f0db9b5e80679e5098.zip glibc-b3fc5f84d13573b9494fb1f0db9b5e80679e5098.tar.gz glibc-b3fc5f84d13573b9494fb1f0db9b5e80679e5098.tar.bz2 |
Update.
* sysdeps/libm-ieee754/e_gamma_r.c: Initialize *signgamp for NaN
returns.
* sysdeps/libm-ieee754/e_gammaf_r.c: Likewise.
* sysdeps/libm-ieee754/e_gammal_r.c: Likewise.
Reported by John Reiser <jreiser@BitWagon.com> [PR libc/1185].
* elf/dl-dst.h: Fix typo.
* elf/dl-open.c: Likewise.
1999-06-26 Zack Weinberg <zack@rabi.columbia.edu>
* elf/dl-libc.c: New file, provides three functions:
__libc_dlopen, __libc_dlclose, __libc_dlsym.
* include/dlfcn.h: Prototype them. Prototype _dl_addr.
* elf/Makefile (routines): Add dl-libc.c.
* elf/dl-profstub.c (_dl_mcount_wrapper): Change type of
argument to void *.
* elf/ldsodefs.h: Change proto and use of _dl_mcount_wrapper to match.
* iconv/gconv.c: Include dlfcn.h.
* iconv/gconv_db.c: Likewise.
* malloc/mtrace.c: Likewise. Don't include ldsodefs.h.
* iconv/gconv_int.h (struct __gconv_loaded_object): Change
`handle' to a void *.
(__gconv_find_func): Delete prototype.
* iconv/gconv_dl.c: Don't include ldsodefs.h. Remove
dlerror_run and related functions and structs. Use
__libc_dlopen, __libc_dlsym, __libc_dlclose.
* nss/nsswitch.c: Likewise.
1999-06-28 Ulrich Drepper <drepper@cygnus.com>
Diffstat (limited to 'nss')
-rw-r--r-- | nss/nsswitch.c | 77 |
1 files changed, 9 insertions, 68 deletions
diff --git a/nss/nsswitch.c b/nss/nsswitch.c index 0fac09e..f125026 100644 --- a/nss/nsswitch.c +++ b/nss/nsswitch.c @@ -26,7 +26,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ldsodefs.h> /* We need some help from ld.so. */ #if !defined DO_STATIC_NSS || defined PIC # include <gnu/lib-names.h> @@ -245,60 +244,6 @@ __nss_configure_lookup (const char *dbname, const char *service_line) } -#if !defined DO_STATIC_NSS || defined PIC -static int -nss_dlerror_run (void (*operate) (void *), void *args) -{ - char *last_errstring = NULL; - int result; - - (void) _dl_catch_error (&last_errstring, operate, args); - - result = last_errstring != NULL; - if (result) - free (last_errstring); - - return result; -} - - -struct do_open_args -{ - /* Argument to do_open. */ - char *shlib_name; - service_user *ni; -}; - -struct get_sym_args -{ - /* Arguments to get_sym. */ - struct link_map *map; - char *name; - - /* Return values of get_sym. */ - ElfW(Addr) loadbase; - const ElfW(Sym) *ref; -}; - -static void -do_open (void *a) -{ - struct do_open_args *args = (struct do_open_args *) a; - /* Open and relocate the shared object. */ - args->ni->library->lib_handle = _dl_open (args->shlib_name, RTLD_LAZY, NULL); -} - -static void -get_sym (void *a) -{ - struct get_sym_args *args = (struct get_sym_args *) a; - args->ref = NULL; - args->loadbase = _dl_lookup_symbol (args->name, &args->ref, - args->map->l_local_scope, - args->map->l_name, 0); -} -#endif - /* Comparison function for searching NI->known tree. */ static int known_compare (const void *p1, const void *p2) @@ -376,18 +321,17 @@ __nss_lookup_function (service_user *ni, const char *fct_name) size_t shlen = (7 + strlen (ni->library->name) + 3 + strlen (__nss_shlib_revision) + 1); int saved_errno = errno; - struct do_open_args args; - args.shlib_name = __alloca (shlen); - args.ni = ni; + char shlib_name[shlen]; /* Construct shared object name. */ - __stpcpy (__stpcpy (__stpcpy (__stpcpy (args.shlib_name, + __stpcpy (__stpcpy (__stpcpy (__stpcpy (shlib_name, "libnss_"), ni->library->name), ".so"), __nss_shlib_revision); - if (nss_dlerror_run (do_open, &args) != 0) + ni->library->lib_handle = __libc_dlopen (shlib_name); + if (ni->library->lib_handle == NULL) { /* Failed to load the library. */ ni->library->lib_handle = (void *) -1l; @@ -400,22 +344,19 @@ __nss_lookup_function (service_user *ni, const char *fct_name) result = NULL; else { - /* Get the desired function. Again, GNU ld.so magic ahead. */ + /* Get the desired function. */ size_t namlen = (5 + strlen (ni->library->name) + 1 + strlen (fct_name) + 1); - struct get_sym_args args; - args.name = __alloca (namlen); - args.map = ni->library->lib_handle; + char name[namlen]; /* Construct the function name. */ - __stpcpy (__stpcpy (__stpcpy (__stpcpy (args.name, "_nss_"), + __stpcpy (__stpcpy (__stpcpy (__stpcpy (name, "_nss_"), ni->library->name), "_"), fct_name); /* Look up the symbol. */ - result = (nss_dlerror_run (get_sym, &args) ? NULL - : (void *) (args.loadbase + args.ref->st_value)); + result = __libc_dlsym (ni->library->lib_handle, name); } #else /* We can't get function address dynamically in static linking. */ @@ -796,7 +737,7 @@ free_mem (void) { service_library *oldl = library; - _dl_close (library->lib_handle); + __libc_dlclose (library->lib_handle); library = library->next; free (oldl); |