diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-10-18 23:30:23 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-10-18 23:30:23 +0000 |
commit | e9e4030ae5f685547a9f7ead1362c7526aa88b80 (patch) | |
tree | 5191067336dc7eed72c15bd9ebdcf9e5ec6af35c /dlfcn/dlerror.c | |
parent | c78cb58c50d04f98c752ee576a0f8e1daae78d38 (diff) | |
download | glibc-e9e4030ae5f685547a9f7ead1362c7526aa88b80.tar glibc-e9e4030ae5f685547a9f7ead1362c7526aa88b80.tar.gz glibc-e9e4030ae5f685547a9f7ead1362c7526aa88b80.tar.bz2 glibc-e9e4030ae5f685547a9f7ead1362c7526aa88b80.zip |
Updated to fedora-glibc-20041018T0940cvs/fedora-glibc-2_3_3-70
Diffstat (limited to 'dlfcn/dlerror.c')
-rw-r--r-- | dlfcn/dlerror.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/dlfcn/dlerror.c b/dlfcn/dlerror.c index 1cde04b080..8789f4f68b 100644 --- a/dlfcn/dlerror.c +++ b/dlfcn/dlerror.c @@ -25,6 +25,16 @@ #include <bits/libc-lock.h> #include <ldsodefs.h> +#if !defined SHARED && defined IS_IN_libdl + +char * +dlerror (void) +{ + return __dlerror (); +} + +#else + /* Type for storing results of dynamic loading actions. */ struct dl_action_result { @@ -46,11 +56,16 @@ static void free_key_mem (void *mem); char * -dlerror (void) +__dlerror (void) { char *buf = NULL; struct dl_action_result *result; +# ifdef SHARED + if (__builtin_expect (_dlfcn_hook != NULL, 0)) + return _dlfcn_hook->dlerror (); +# endif + /* If we have not yet initialized the buffer do it now. */ __libc_once (once, init); @@ -99,6 +114,9 @@ dlerror (void) return buf; } +# ifdef SHARED +strong_alias (__dlerror, dlerror) +# endif int internal_function @@ -185,3 +203,35 @@ free_key_mem (void *mem) free (mem); __libc_setspecific (key, NULL); } + +# ifdef SHARED + +struct dlfcn_hook *_dlfcn_hook __attribute__((nocommon)); +libdl_hidden_data_def (_dlfcn_hook) + +# else + +static struct dlfcn_hook _dlfcn_hooks = + { + .dlopen = __dlopen, + .dlclose = __dlclose, + .dlsym = __dlsym, + .dlvsym = __dlvsym, + .dlerror = __dlerror, + .dladdr = __dladdr, + .dladdr1 = __dladdr1, + .dlinfo = __dlinfo, + .dlmopen = __dlmopen + }; + +void +__libc_register_dlfcn_hook (struct link_map *map) +{ + struct dlfcn_hook **hook; + + hook = (struct dlfcn_hook **) __libc_dlsym_private (map, "_dlfcn_hook"); + if (hook != NULL) + *hook = &_dlfcn_hooks; +} +# endif +#endif |