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/dlopen.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/dlopen.c')
-rw-r--r-- | dlfcn/dlopen.c | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c index cfd7963545..6381ffc9b1 100644 --- a/dlfcn/dlopen.c +++ b/dlfcn/dlopen.c @@ -20,6 +20,17 @@ #include <dlfcn.h> #include <stddef.h> +#if !defined SHARED && defined IS_IN_libdl + +void * +dlopen (const char *file, int mode) +{ + return __dlopen (file, mode, RETURN_ADDRESS (0)); +} +static_link_warning (dlopen) + +#else + struct dlopen_args { /* The arguments for dlopen_doit. */ @@ -33,11 +44,11 @@ struct dlopen_args /* Non-shared code has no support for multiple namespaces. */ -#ifdef SHARED -# define NS __LM_ID_CALLER -#else -# define NS LM_ID_BASE -#endif +# ifdef SHARED +# define NS __LM_ID_CALLER +# else +# define NS LM_ID_BASE +# endif static void @@ -50,17 +61,34 @@ dlopen_doit (void *a) } -extern void *__dlopen_check (const char *file, int mode); void * -__dlopen_check (const char *file, int mode) +__dlopen (const char *file, int mode DL_CALLER_DECL) { +# ifdef SHARED + if (__builtin_expect (_dlfcn_hook != NULL, 0)) + return _dlfcn_hook->dlopen (file, mode, DL_CALLER); +# endif + struct dlopen_args args; args.file = file; args.mode = mode; - args.caller = RETURN_ADDRESS (0); + args.caller = DL_CALLER; +# ifdef SHARED return _dlerror_run (dlopen_doit, &args) ? NULL : args.new; +# else + if (_dlerror_run (dlopen_doit, &args)) + return NULL; + + __libc_register_dl_open_hook ((struct link_map *) args.new); + __libc_register_dlfcn_hook ((struct link_map *) args.new); + + return args.new; +# endif } -#include <shlib-compat.h> +# ifdef SHARED +# include <shlib-compat.h> +strong_alias (__dlopen, __dlopen_check) versioned_symbol (libdl, __dlopen_check, dlopen, GLIBC_2_1); -static_link_warning (dlopen) +# endif +#endif |