diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-02-08 10:05:09 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-02-08 10:05:09 +0000 |
commit | d585b66fa4d11059948f466c9080a6826932358d (patch) | |
tree | 8b06692920852c297635b46a7d616c3066f95fac /dlfcn | |
parent | e7cbcee4982d8caa809a91c9cfef5fda67445f0a (diff) |
Updated to fedora-glibc-20050208T0948cvs/fedora-glibc-2_3_4-6
Diffstat (limited to 'dlfcn')
-rw-r--r-- | dlfcn/Makefile | 8 | ||||
-rw-r--r-- | dlfcn/dlclose.c | 3 | ||||
-rw-r--r-- | dlfcn/dlfcn.c | 33 | ||||
-rw-r--r-- | dlfcn/dlmopen.c | 7 | ||||
-rw-r--r-- | dlfcn/dlopen.c | 15 | ||||
-rw-r--r-- | dlfcn/dlopenold.c | 8 |
6 files changed, 61 insertions, 13 deletions
diff --git a/dlfcn/Makefile b/dlfcn/Makefile index ed20ae5ccd..7b538fed2b 100644 --- a/dlfcn/Makefile +++ b/dlfcn/Makefile @@ -20,8 +20,8 @@ subdir := dlfcn headers := bits/dlfcn.h dlfcn.h extra-libs := libdl libdl-routines := dlopen dlclose dlsym dlvsym dlerror dladdr dladdr1 dlinfo \ - dlmopen -routines := $(patsubst %,s%,$(libdl-routines)) + dlmopen dlfcn +routines := $(patsubst %,s%,$(filter-out dlfcn,$(libdl-routines))) elide-routines.os := $(routines) distribute := dlopenold.c glreflib1.c glreflib2.c failtestmod.c \ defaultmod1.c defaultmod2.c errmsg1mod.c modatexit.c \ @@ -34,7 +34,7 @@ include ../Makeconfig ifeq ($(versioning),yes) libdl-routines += dlopenold -libdl-shared-only-routines := dlopenold +libdl-shared-only-routines := dlopenold dlfcn endif ifeq (yes,$(build-shared)) @@ -65,8 +65,6 @@ generated := $(modules-names:=.so) include ../Rules -LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name) - test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) $(test-modules): $(objpfx)%.so: $(objpfx)%.os $(common-objpfx)shlib.lds $(build-module) diff --git a/dlfcn/dlclose.c b/dlfcn/dlclose.c index 3ddedcffbe..5a344f31ca 100644 --- a/dlfcn/dlclose.c +++ b/dlfcn/dlclose.c @@ -19,6 +19,7 @@ 02111-1307 USA. */ #include <dlfcn.h> +#include <ldsodefs.h> #if !defined SHARED && defined IS_IN_libdl @@ -33,7 +34,7 @@ dlclose (void *handle) static void dlclose_doit (void *handle) { - _dl_close (handle); + GLRO(dl_close) (handle); } int diff --git a/dlfcn/dlfcn.c b/dlfcn/dlfcn.c new file mode 100644 index 0000000000..9c0a84afb8 --- /dev/null +++ b/dlfcn/dlfcn.c @@ -0,0 +1,33 @@ +/* Load a shared object at run time. + Copyright (C) 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <dlfcn.h> + + +int __dlfcn_argc attribute_hidden; +char **__dlfcn_argv attribute_hidden; + + +void +__attribute__ ((constructor)) +init (int argc, char *argv[]) +{ + __dlfcn_argc = argc; + __dlfcn_argv = argv; +} diff --git a/dlfcn/dlmopen.c b/dlfcn/dlmopen.c index 5fd6543655..0a6d47ea2e 100644 --- a/dlfcn/dlmopen.c +++ b/dlfcn/dlmopen.c @@ -21,6 +21,7 @@ #include <errno.h> #include <libintl.h> #include <stddef.h> +#include <unistd.h> #include <ldsodefs.h> #if !defined SHARED && defined IS_IN_libdl @@ -61,8 +62,10 @@ dlmopen_doit (void *a) # endif GLRO(dl_signal_error) (EINVAL, NULL, NULL, N_("invalid namespace")); - args->new = _dl_open (args->file ?: "", args->mode | __RTLD_DLOPEN, - args->caller, args->nsid); + args->new = GLRO(dl_open) (args->file ?: "", args->mode | __RTLD_DLOPEN, + args->caller, + args->nsid, __dlfcn_argc, __dlfcn_argv, + __environ); } diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c index 6381ffc9b1..bffb512aa3 100644 --- a/dlfcn/dlopen.c +++ b/dlfcn/dlopen.c @@ -1,5 +1,5 @@ /* Load a shared object at run time. - Copyright (C) 1995,96,97,98,99,2000,2003,2004 Free Software Foundation, Inc. + Copyright (C) 1995-2000,2003,2004,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,7 +18,10 @@ 02111-1307 USA. */ #include <dlfcn.h> +#include <libintl.h> #include <stddef.h> +#include <unistd.h> +#include <ldsodefs.h> #if !defined SHARED && defined IS_IN_libdl @@ -56,8 +59,14 @@ dlopen_doit (void *a) { struct dlopen_args *args = (struct dlopen_args *) a; - args->new = _dl_open (args->file ?: "", args->mode | __RTLD_DLOPEN, - args->caller, args->file == NULL ? LM_ID_BASE : NS); + if (args->mode & ~(RTLD_BINDING_MASK | RTLD_NOLOAD | RTLD_DEEPBIND + | RTLD_GLOBAL | RTLD_LOCAL | RTLD_NODELETE)) + GLRO(dl_signal_error) (0, NULL, NULL, _("invalid mode parameter")); + + args->new = GLRO(dl_open) (args->file ?: "", args->mode | __RTLD_DLOPEN, + args->caller, + args->file == NULL ? LM_ID_BASE : NS, + __dlfcn_argc, __dlfcn_argv, __environ); } diff --git a/dlfcn/dlopenold.c b/dlfcn/dlopenold.c index 148716cdb0..8dae1c40ce 100644 --- a/dlfcn/dlopenold.c +++ b/dlfcn/dlopenold.c @@ -19,6 +19,8 @@ #include <dlfcn.h> #include <stddef.h> +#include <unistd.h> +#include <ldsodefs.h> /* This file is for compatibility with glibc 2.0. Compile it only if versioning is used. */ @@ -50,8 +52,10 @@ dlopen_doit (void *a) { struct dlopen_args *args = (struct dlopen_args *) a; - args->new = _dl_open (args->file ?: "", args->mode | __RTLD_DLOPEN, - args->caller, args->file == NULL ? LM_ID_BASE : NS); + args->new = GLRO(dl_open) (args->file ?: "", args->mode | __RTLD_DLOPEN, + args->caller, + args->file == NULL ? LM_ID_BASE : NS, + __dlfcn_argc, __dlfcn_argv, __environ); } extern void *__dlopen_nocheck (const char *file, int mode); |