glibc/elf/dl-sym.c

159 lines
4.4 KiB
C
Raw Normal View History

Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
/* Look up a symbol in a shared object loaded by `dlopen'.
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
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 Library General Public License as
published by the Free Software Foundation; either version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stddef.h>
#include <setjmp.h>
#include <libintl.h>
#include <dlfcn.h>
#include <ldsodefs.h>
#include <dl-hash.h>
void *
internal_function
_dl_sym (void *handle, const char *name, void *who)
{
const ElfW(Sym) *ref = NULL;
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
lookup_t result;
Update. 2000-08-26 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (distribute): Add unloadmod.c, reldepmod1.c, reldepmod2.c, reldepmod3.c, and reldepmod4.c. (tests): Add unload, reldep, reldep2, and reldep3. (modules-names): Add unloadmod, reldepmod1, reldepmod2, reldepmod3, and reldepmod4. Add rules to build and run unload, reldep, reldep2, and reldep3. * elf/dl-lookup.c (_dl_lookup_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_symbol_skip): Remove relocation dependency stuff. This can never happen here. (_dl_lookup_versioned_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_versioned_symbol_skip): Remove relocation dependency stuff. This can never happen here. * sysdeps/generic/ldsodefs.h: Change prototypes. * elf/dl-reloc.c (RESOLVE_MAP): Pass 0 in explicit parameter to _dl_lookup_up and _dl_lookup_versioned_symbol. (RESOLV): Likewise. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise. * elf/dl-libc.c (do_dlsym): Pass 1 in explicit parameter to _dl_lookup_symbol. * elf/dl-symbol.c (_dl_symbol_value): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-sym.c (_dl_sym): Pass 1 in explicit parameter to _dl_lookup_symbol if handle is not RTLD_DEFAULT. Always compute and pass down the caller map. (_dl_vsym): Likewise. * elf/reldep.c: New file. * elf/reldep2.c: New file. * elf/reldep3.c: New file. * elf/reldepmod1.c: New file. * elf/reldepmod2.c: New file. * elf/reldepmod3.c: New file. * elf/reldepmod4.c: New file. * elf/unload.c: New file. * elf/unloadmod.c: New file. * elf/do-lookup.h: Remove unused undef_name parameter. * elf/dl-lookup.c: Adjust callers.
2000-08-27 01:41:19 +02:00
ElfW(Addr) caller = (ElfW(Addr)) who;
struct link_map *match;
struct link_map *l;
/* If the address is not recognized the call comes from the main
program (we hope). */
match = _dl_loaded;
Update. 2000-08-26 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (distribute): Add unloadmod.c, reldepmod1.c, reldepmod2.c, reldepmod3.c, and reldepmod4.c. (tests): Add unload, reldep, reldep2, and reldep3. (modules-names): Add unloadmod, reldepmod1, reldepmod2, reldepmod3, and reldepmod4. Add rules to build and run unload, reldep, reldep2, and reldep3. * elf/dl-lookup.c (_dl_lookup_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_symbol_skip): Remove relocation dependency stuff. This can never happen here. (_dl_lookup_versioned_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_versioned_symbol_skip): Remove relocation dependency stuff. This can never happen here. * sysdeps/generic/ldsodefs.h: Change prototypes. * elf/dl-reloc.c (RESOLVE_MAP): Pass 0 in explicit parameter to _dl_lookup_up and _dl_lookup_versioned_symbol. (RESOLV): Likewise. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise. * elf/dl-libc.c (do_dlsym): Pass 1 in explicit parameter to _dl_lookup_symbol. * elf/dl-symbol.c (_dl_symbol_value): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-sym.c (_dl_sym): Pass 1 in explicit parameter to _dl_lookup_symbol if handle is not RTLD_DEFAULT. Always compute and pass down the caller map. (_dl_vsym): Likewise. * elf/reldep.c: New file. * elf/reldep2.c: New file. * elf/reldep3.c: New file. * elf/reldepmod1.c: New file. * elf/reldepmod2.c: New file. * elf/reldepmod3.c: New file. * elf/reldepmod4.c: New file. * elf/unload.c: New file. * elf/unloadmod.c: New file. * elf/do-lookup.h: Remove unused undef_name parameter. * elf/dl-lookup.c: Adjust callers.
2000-08-27 01:41:19 +02:00
/* Find the highest-addressed object that CALLER is not below. */
for (l = _dl_loaded; l != NULL; l = l->l_next)
Update. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1255.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1255. * iconvdata/testdata/WINDOWS-1255: New file. * iconvdata/testdata/WINDOWS-1255..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1255 test. * iconvdata/CP1255.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1258.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1258. * iconvdata/testdata/WINDOWS-1258: New file. * iconvdata/testdata/WINDOWS-1258..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1258 test. * iconvdata/tst-table-from.c (try): Reset the iconv descriptor before the main call, and flush it afterwards. (utf8_decode): Return a string, possibly containing several Unicode characters. (main): Update all utf8_decode calls. * iconvdata/CP1258.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconv/gconv.c (__gconv): For flush without output, pass do_flush = 2. * iconv/skeleton.c: Distinguish do_flush = 1 and do_flush = 2. In the first case, set outbuf, outstart, outend, and call PREPARE_LOOP before EMIT_SHIFT_TO_INIT; then pass the output produced by this step down to the next step. In the second case, clear the state without calling EMIT_SHIFT_TO_INIT. * iconvdata/ibm930.c (EMIT_SHIFT_TO_INIT): Use outbuf instead of data->__outbuf, and outend instead of data->__outbufend. * iconvdata/ibm933.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm935.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm937.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm939.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn-ext.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-jp.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/utf-7.c (EMIT_SHIFT_TO_INIT): Likewise. 2001-05-21 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (dl_main): Compute l_map_end for the main program. * elf/dl-sym.c (_dl_sym): Don't check for l_addr == 0. If match == _dl_loaded, caller can still come from the main program. (_dl_vsym): Likewise. * elf/dl-open.c (dl_open_worker): Don't check for l_addr == 0. * elf/dl-error.c (_dl_signal_error): Change NULL objname into "". * elf/restest2.c: New test. * elf/Makefile (tests): Add restest2. (restest2, LDFLAGS-restest2): Add rules.
2001-05-23 00:30:18 +02:00
if (caller >= l->l_map_start && caller < l->l_map_end)
{
/* There must be exactly one DSO for the range of the virtual
memory. Otherwise something is really broken. */
match = l;
break;
}
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
if (handle == RTLD_DEFAULT)
/* Search the global scope as seen in the caller object. */
result = _dl_lookup_symbol (name, match, &ref, match->l_scope, 0, 0);
else
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
{
if (handle != RTLD_NEXT)
{
/* Search the scope of the given object. */
struct link_map *map = handle;
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
result = _dl_lookup_symbol (name, match, &ref, map->l_local_scope,
Update. 2000-08-26 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (distribute): Add unloadmod.c, reldepmod1.c, reldepmod2.c, reldepmod3.c, and reldepmod4.c. (tests): Add unload, reldep, reldep2, and reldep3. (modules-names): Add unloadmod, reldepmod1, reldepmod2, reldepmod3, and reldepmod4. Add rules to build and run unload, reldep, reldep2, and reldep3. * elf/dl-lookup.c (_dl_lookup_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_symbol_skip): Remove relocation dependency stuff. This can never happen here. (_dl_lookup_versioned_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_versioned_symbol_skip): Remove relocation dependency stuff. This can never happen here. * sysdeps/generic/ldsodefs.h: Change prototypes. * elf/dl-reloc.c (RESOLVE_MAP): Pass 0 in explicit parameter to _dl_lookup_up and _dl_lookup_versioned_symbol. (RESOLV): Likewise. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise. * elf/dl-libc.c (do_dlsym): Pass 1 in explicit parameter to _dl_lookup_symbol. * elf/dl-symbol.c (_dl_symbol_value): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-sym.c (_dl_sym): Pass 1 in explicit parameter to _dl_lookup_symbol if handle is not RTLD_DEFAULT. Always compute and pass down the caller map. (_dl_vsym): Likewise. * elf/reldep.c: New file. * elf/reldep2.c: New file. * elf/reldep3.c: New file. * elf/reldepmod1.c: New file. * elf/reldepmod2.c: New file. * elf/reldepmod3.c: New file. * elf/reldepmod4.c: New file. * elf/unload.c: New file. * elf/unloadmod.c: New file. * elf/do-lookup.h: Remove unused undef_name parameter. * elf/dl-lookup.c: Adjust callers.
2000-08-27 01:41:19 +02:00
0, 1);
}
else
{
if (__builtin_expect (match == _dl_loaded, 0))
Update. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1255.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1255. * iconvdata/testdata/WINDOWS-1255: New file. * iconvdata/testdata/WINDOWS-1255..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1255 test. * iconvdata/CP1255.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1258.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1258. * iconvdata/testdata/WINDOWS-1258: New file. * iconvdata/testdata/WINDOWS-1258..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1258 test. * iconvdata/tst-table-from.c (try): Reset the iconv descriptor before the main call, and flush it afterwards. (utf8_decode): Return a string, possibly containing several Unicode characters. (main): Update all utf8_decode calls. * iconvdata/CP1258.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconv/gconv.c (__gconv): For flush without output, pass do_flush = 2. * iconv/skeleton.c: Distinguish do_flush = 1 and do_flush = 2. In the first case, set outbuf, outstart, outend, and call PREPARE_LOOP before EMIT_SHIFT_TO_INIT; then pass the output produced by this step down to the next step. In the second case, clear the state without calling EMIT_SHIFT_TO_INIT. * iconvdata/ibm930.c (EMIT_SHIFT_TO_INIT): Use outbuf instead of data->__outbuf, and outend instead of data->__outbufend. * iconvdata/ibm933.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm935.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm937.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm939.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn-ext.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-jp.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/utf-7.c (EMIT_SHIFT_TO_INIT): Likewise. 2001-05-21 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (dl_main): Compute l_map_end for the main program. * elf/dl-sym.c (_dl_sym): Don't check for l_addr == 0. If match == _dl_loaded, caller can still come from the main program. (_dl_vsym): Likewise. * elf/dl-open.c (dl_open_worker): Don't check for l_addr == 0. * elf/dl-error.c (_dl_signal_error): Change NULL objname into "". * elf/restest2.c: New test. * elf/Makefile (tests): Add restest2. (restest2, LDFLAGS-restest2): Add rules.
2001-05-23 00:30:18 +02:00
{
if (! _dl_loaded
|| caller < _dl_loaded->l_map_start
|| caller >= _dl_loaded->l_map_end)
_dl_signal_error (0, NULL, N_("\
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
RTLD_NEXT used in code not dynamically loaded"));
Update. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1255.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1255. * iconvdata/testdata/WINDOWS-1255: New file. * iconvdata/testdata/WINDOWS-1255..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1255 test. * iconvdata/CP1255.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1258.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1258. * iconvdata/testdata/WINDOWS-1258: New file. * iconvdata/testdata/WINDOWS-1258..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1258 test. * iconvdata/tst-table-from.c (try): Reset the iconv descriptor before the main call, and flush it afterwards. (utf8_decode): Return a string, possibly containing several Unicode characters. (main): Update all utf8_decode calls. * iconvdata/CP1258.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconv/gconv.c (__gconv): For flush without output, pass do_flush = 2. * iconv/skeleton.c: Distinguish do_flush = 1 and do_flush = 2. In the first case, set outbuf, outstart, outend, and call PREPARE_LOOP before EMIT_SHIFT_TO_INIT; then pass the output produced by this step down to the next step. In the second case, clear the state without calling EMIT_SHIFT_TO_INIT. * iconvdata/ibm930.c (EMIT_SHIFT_TO_INIT): Use outbuf instead of data->__outbuf, and outend instead of data->__outbufend. * iconvdata/ibm933.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm935.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm937.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm939.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn-ext.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-jp.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/utf-7.c (EMIT_SHIFT_TO_INIT): Likewise. 2001-05-21 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (dl_main): Compute l_map_end for the main program. * elf/dl-sym.c (_dl_sym): Don't check for l_addr == 0. If match == _dl_loaded, caller can still come from the main program. (_dl_vsym): Likewise. * elf/dl-open.c (dl_open_worker): Don't check for l_addr == 0. * elf/dl-error.c (_dl_signal_error): Change NULL objname into "". * elf/restest2.c: New test. * elf/Makefile (tests): Add restest2. (restest2, LDFLAGS-restest2): Add rules.
2001-05-23 00:30:18 +02:00
}
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
l = match;
while (l->l_loader != NULL)
l = l->l_loader;
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
result = _dl_lookup_symbol_skip (name, l, &ref, l->l_local_scope,
match);
}
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
}
if (ref != NULL)
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
return DL_SYMBOL_ADDRESS (result, ref);
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
return NULL;
}
void *
internal_function
_dl_vsym (void *handle, const char *name, const char *version, void *who)
{
const ElfW(Sym) *ref = NULL;
struct r_found_version vers;
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
lookup_t result;
Update. 2000-08-26 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (distribute): Add unloadmod.c, reldepmod1.c, reldepmod2.c, reldepmod3.c, and reldepmod4.c. (tests): Add unload, reldep, reldep2, and reldep3. (modules-names): Add unloadmod, reldepmod1, reldepmod2, reldepmod3, and reldepmod4. Add rules to build and run unload, reldep, reldep2, and reldep3. * elf/dl-lookup.c (_dl_lookup_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_symbol_skip): Remove relocation dependency stuff. This can never happen here. (_dl_lookup_versioned_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_versioned_symbol_skip): Remove relocation dependency stuff. This can never happen here. * sysdeps/generic/ldsodefs.h: Change prototypes. * elf/dl-reloc.c (RESOLVE_MAP): Pass 0 in explicit parameter to _dl_lookup_up and _dl_lookup_versioned_symbol. (RESOLV): Likewise. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise. * elf/dl-libc.c (do_dlsym): Pass 1 in explicit parameter to _dl_lookup_symbol. * elf/dl-symbol.c (_dl_symbol_value): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-sym.c (_dl_sym): Pass 1 in explicit parameter to _dl_lookup_symbol if handle is not RTLD_DEFAULT. Always compute and pass down the caller map. (_dl_vsym): Likewise. * elf/reldep.c: New file. * elf/reldep2.c: New file. * elf/reldep3.c: New file. * elf/reldepmod1.c: New file. * elf/reldepmod2.c: New file. * elf/reldepmod3.c: New file. * elf/reldepmod4.c: New file. * elf/unload.c: New file. * elf/unloadmod.c: New file. * elf/do-lookup.h: Remove unused undef_name parameter. * elf/dl-lookup.c: Adjust callers.
2000-08-27 01:41:19 +02:00
ElfW(Addr) caller = (ElfW(Addr)) who;
struct link_map *match;
struct link_map *l;
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
/* Compute hash value to the version string. */
vers.name = version;
vers.hidden = 1;
vers.hash = _dl_elf_hash (version);
/* We don't have a specific file where the symbol can be found. */
vers.filename = NULL;
/* If the address is not recognized the call comes from the main
program (we hope). */
match = _dl_loaded;
Update. 2000-08-26 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (distribute): Add unloadmod.c, reldepmod1.c, reldepmod2.c, reldepmod3.c, and reldepmod4.c. (tests): Add unload, reldep, reldep2, and reldep3. (modules-names): Add unloadmod, reldepmod1, reldepmod2, reldepmod3, and reldepmod4. Add rules to build and run unload, reldep, reldep2, and reldep3. * elf/dl-lookup.c (_dl_lookup_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_symbol_skip): Remove relocation dependency stuff. This can never happen here. (_dl_lookup_versioned_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_versioned_symbol_skip): Remove relocation dependency stuff. This can never happen here. * sysdeps/generic/ldsodefs.h: Change prototypes. * elf/dl-reloc.c (RESOLVE_MAP): Pass 0 in explicit parameter to _dl_lookup_up and _dl_lookup_versioned_symbol. (RESOLV): Likewise. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise. * elf/dl-libc.c (do_dlsym): Pass 1 in explicit parameter to _dl_lookup_symbol. * elf/dl-symbol.c (_dl_symbol_value): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-sym.c (_dl_sym): Pass 1 in explicit parameter to _dl_lookup_symbol if handle is not RTLD_DEFAULT. Always compute and pass down the caller map. (_dl_vsym): Likewise. * elf/reldep.c: New file. * elf/reldep2.c: New file. * elf/reldep3.c: New file. * elf/reldepmod1.c: New file. * elf/reldepmod2.c: New file. * elf/reldepmod3.c: New file. * elf/reldepmod4.c: New file. * elf/unload.c: New file. * elf/unloadmod.c: New file. * elf/do-lookup.h: Remove unused undef_name parameter. * elf/dl-lookup.c: Adjust callers.
2000-08-27 01:41:19 +02:00
/* Find the highest-addressed object that CALLER is not below. */
for (l = _dl_loaded; l != NULL; l = l->l_next)
Update. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1255.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1255. * iconvdata/testdata/WINDOWS-1255: New file. * iconvdata/testdata/WINDOWS-1255..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1255 test. * iconvdata/CP1255.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1258.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1258. * iconvdata/testdata/WINDOWS-1258: New file. * iconvdata/testdata/WINDOWS-1258..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1258 test. * iconvdata/tst-table-from.c (try): Reset the iconv descriptor before the main call, and flush it afterwards. (utf8_decode): Return a string, possibly containing several Unicode characters. (main): Update all utf8_decode calls. * iconvdata/CP1258.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconv/gconv.c (__gconv): For flush without output, pass do_flush = 2. * iconv/skeleton.c: Distinguish do_flush = 1 and do_flush = 2. In the first case, set outbuf, outstart, outend, and call PREPARE_LOOP before EMIT_SHIFT_TO_INIT; then pass the output produced by this step down to the next step. In the second case, clear the state without calling EMIT_SHIFT_TO_INIT. * iconvdata/ibm930.c (EMIT_SHIFT_TO_INIT): Use outbuf instead of data->__outbuf, and outend instead of data->__outbufend. * iconvdata/ibm933.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm935.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm937.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm939.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn-ext.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-jp.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/utf-7.c (EMIT_SHIFT_TO_INIT): Likewise. 2001-05-21 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (dl_main): Compute l_map_end for the main program. * elf/dl-sym.c (_dl_sym): Don't check for l_addr == 0. If match == _dl_loaded, caller can still come from the main program. (_dl_vsym): Likewise. * elf/dl-open.c (dl_open_worker): Don't check for l_addr == 0. * elf/dl-error.c (_dl_signal_error): Change NULL objname into "". * elf/restest2.c: New test. * elf/Makefile (tests): Add restest2. (restest2, LDFLAGS-restest2): Add rules.
2001-05-23 00:30:18 +02:00
if (caller >= l->l_map_start && caller < l->l_map_end)
{
/* There must be exactly one DSO for the range of the virtual
memory. Otherwise something is really broken. */
match = l;
break;
}
Update. 2000-08-26 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (distribute): Add unloadmod.c, reldepmod1.c, reldepmod2.c, reldepmod3.c, and reldepmod4.c. (tests): Add unload, reldep, reldep2, and reldep3. (modules-names): Add unloadmod, reldepmod1, reldepmod2, reldepmod3, and reldepmod4. Add rules to build and run unload, reldep, reldep2, and reldep3. * elf/dl-lookup.c (_dl_lookup_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_symbol_skip): Remove relocation dependency stuff. This can never happen here. (_dl_lookup_versioned_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_versioned_symbol_skip): Remove relocation dependency stuff. This can never happen here. * sysdeps/generic/ldsodefs.h: Change prototypes. * elf/dl-reloc.c (RESOLVE_MAP): Pass 0 in explicit parameter to _dl_lookup_up and _dl_lookup_versioned_symbol. (RESOLV): Likewise. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise. * elf/dl-libc.c (do_dlsym): Pass 1 in explicit parameter to _dl_lookup_symbol. * elf/dl-symbol.c (_dl_symbol_value): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-sym.c (_dl_sym): Pass 1 in explicit parameter to _dl_lookup_symbol if handle is not RTLD_DEFAULT. Always compute and pass down the caller map. (_dl_vsym): Likewise. * elf/reldep.c: New file. * elf/reldep2.c: New file. * elf/reldep3.c: New file. * elf/reldepmod1.c: New file. * elf/reldepmod2.c: New file. * elf/reldepmod3.c: New file. * elf/reldepmod4.c: New file. * elf/unload.c: New file. * elf/unloadmod.c: New file. * elf/do-lookup.h: Remove unused undef_name parameter. * elf/dl-lookup.c: Adjust callers.
2000-08-27 01:41:19 +02:00
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
if (handle == RTLD_DEFAULT)
/* Search the global scope. */
result = _dl_lookup_versioned_symbol (name, match, &ref, match->l_scope,
Update. 2000-08-26 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (distribute): Add unloadmod.c, reldepmod1.c, reldepmod2.c, reldepmod3.c, and reldepmod4.c. (tests): Add unload, reldep, reldep2, and reldep3. (modules-names): Add unloadmod, reldepmod1, reldepmod2, reldepmod3, and reldepmod4. Add rules to build and run unload, reldep, reldep2, and reldep3. * elf/dl-lookup.c (_dl_lookup_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_symbol_skip): Remove relocation dependency stuff. This can never happen here. (_dl_lookup_versioned_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_versioned_symbol_skip): Remove relocation dependency stuff. This can never happen here. * sysdeps/generic/ldsodefs.h: Change prototypes. * elf/dl-reloc.c (RESOLVE_MAP): Pass 0 in explicit parameter to _dl_lookup_up and _dl_lookup_versioned_symbol. (RESOLV): Likewise. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise. * elf/dl-libc.c (do_dlsym): Pass 1 in explicit parameter to _dl_lookup_symbol. * elf/dl-symbol.c (_dl_symbol_value): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-sym.c (_dl_sym): Pass 1 in explicit parameter to _dl_lookup_symbol if handle is not RTLD_DEFAULT. Always compute and pass down the caller map. (_dl_vsym): Likewise. * elf/reldep.c: New file. * elf/reldep2.c: New file. * elf/reldep3.c: New file. * elf/reldepmod1.c: New file. * elf/reldepmod2.c: New file. * elf/reldepmod3.c: New file. * elf/reldepmod4.c: New file. * elf/unload.c: New file. * elf/unloadmod.c: New file. * elf/do-lookup.h: Remove unused undef_name parameter. * elf/dl-lookup.c: Adjust callers.
2000-08-27 01:41:19 +02:00
&vers, 0, 0);
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
else if (handle == RTLD_NEXT)
{
Update. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1255.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1255. * iconvdata/testdata/WINDOWS-1255: New file. * iconvdata/testdata/WINDOWS-1255..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1255 test. * iconvdata/CP1255.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1258.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1258. * iconvdata/testdata/WINDOWS-1258: New file. * iconvdata/testdata/WINDOWS-1258..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1258 test. * iconvdata/tst-table-from.c (try): Reset the iconv descriptor before the main call, and flush it afterwards. (utf8_decode): Return a string, possibly containing several Unicode characters. (main): Update all utf8_decode calls. * iconvdata/CP1258.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconv/gconv.c (__gconv): For flush without output, pass do_flush = 2. * iconv/skeleton.c: Distinguish do_flush = 1 and do_flush = 2. In the first case, set outbuf, outstart, outend, and call PREPARE_LOOP before EMIT_SHIFT_TO_INIT; then pass the output produced by this step down to the next step. In the second case, clear the state without calling EMIT_SHIFT_TO_INIT. * iconvdata/ibm930.c (EMIT_SHIFT_TO_INIT): Use outbuf instead of data->__outbuf, and outend instead of data->__outbufend. * iconvdata/ibm933.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm935.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm937.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm939.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn-ext.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-jp.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/utf-7.c (EMIT_SHIFT_TO_INIT): Likewise. 2001-05-21 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (dl_main): Compute l_map_end for the main program. * elf/dl-sym.c (_dl_sym): Don't check for l_addr == 0. If match == _dl_loaded, caller can still come from the main program. (_dl_vsym): Likewise. * elf/dl-open.c (dl_open_worker): Don't check for l_addr == 0. * elf/dl-error.c (_dl_signal_error): Change NULL objname into "". * elf/restest2.c: New test. * elf/Makefile (tests): Add restest2. (restest2, LDFLAGS-restest2): Add rules.
2001-05-23 00:30:18 +02:00
if (__builtin_expect (match == _dl_loaded, 0))
{
if (! _dl_loaded
|| caller < _dl_loaded->l_map_start
|| caller >= _dl_loaded->l_map_end)
_dl_signal_error (0, NULL, N_("\
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
RTLD_NEXT used in code not dynamically loaded"));
Update. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1255.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1255. * iconvdata/testdata/WINDOWS-1255: New file. * iconvdata/testdata/WINDOWS-1255..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1255 test. * iconvdata/CP1255.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconvdata/cp1258.c: Completely rewritten. * iconvdata/Makefile (gen-8bit-gap-modules): Remove cp1258. * iconvdata/testdata/WINDOWS-1258: New file. * iconvdata/testdata/WINDOWS-1258..UTF8: New file. * iconvdata/TESTS: Add WINDOWS-1258 test. * iconvdata/tst-table-from.c (try): Reset the iconv descriptor before the main call, and flush it afterwards. (utf8_decode): Return a string, possibly containing several Unicode characters. (main): Update all utf8_decode calls. * iconvdata/CP1258.irreversible: New file. 2001-05-20 Bruno Haible <haible@clisp.cons.org> * iconv/gconv.c (__gconv): For flush without output, pass do_flush = 2. * iconv/skeleton.c: Distinguish do_flush = 1 and do_flush = 2. In the first case, set outbuf, outstart, outend, and call PREPARE_LOOP before EMIT_SHIFT_TO_INIT; then pass the output produced by this step down to the next step. In the second case, clear the state without calling EMIT_SHIFT_TO_INIT. * iconvdata/ibm930.c (EMIT_SHIFT_TO_INIT): Use outbuf instead of data->__outbuf, and outend instead of data->__outbufend. * iconvdata/ibm933.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm935.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm937.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/ibm939.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-cn-ext.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-jp.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/iso-2022-kr.c (EMIT_SHIFT_TO_INIT): Likewise. * iconvdata/utf-7.c (EMIT_SHIFT_TO_INIT): Likewise. 2001-05-21 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (dl_main): Compute l_map_end for the main program. * elf/dl-sym.c (_dl_sym): Don't check for l_addr == 0. If match == _dl_loaded, caller can still come from the main program. (_dl_vsym): Likewise. * elf/dl-open.c (dl_open_worker): Don't check for l_addr == 0. * elf/dl-error.c (_dl_signal_error): Change NULL objname into "". * elf/restest2.c: New test. * elf/Makefile (tests): Add restest2. (restest2, LDFLAGS-restest2): Add rules.
2001-05-23 00:30:18 +02:00
}
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
l = match;
while (l->l_loader != NULL)
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
l = l->l_loader;
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
result = _dl_lookup_versioned_symbol_skip (name, l, &ref,
l->l_local_scope,
&vers, match);
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
}
else
{
/* Search the scope of the given object. */
struct link_map *map = handle;
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
result = _dl_lookup_versioned_symbol (name, map, &ref,
Update. 2000-08-26 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (distribute): Add unloadmod.c, reldepmod1.c, reldepmod2.c, reldepmod3.c, and reldepmod4.c. (tests): Add unload, reldep, reldep2, and reldep3. (modules-names): Add unloadmod, reldepmod1, reldepmod2, reldepmod3, and reldepmod4. Add rules to build and run unload, reldep, reldep2, and reldep3. * elf/dl-lookup.c (_dl_lookup_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_symbol_skip): Remove relocation dependency stuff. This can never happen here. (_dl_lookup_versioned_symbol): Add new parameter explicit. Don't create relocation dependency if it is nonzero. (_dl_lookup_versioned_symbol_skip): Remove relocation dependency stuff. This can never happen here. * sysdeps/generic/ldsodefs.h: Change prototypes. * elf/dl-reloc.c (RESOLVE_MAP): Pass 0 in explicit parameter to _dl_lookup_up and _dl_lookup_versioned_symbol. (RESOLV): Likewise. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise. * elf/dl-libc.c (do_dlsym): Pass 1 in explicit parameter to _dl_lookup_symbol. * elf/dl-symbol.c (_dl_symbol_value): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/dl-sym.c (_dl_sym): Pass 1 in explicit parameter to _dl_lookup_symbol if handle is not RTLD_DEFAULT. Always compute and pass down the caller map. (_dl_vsym): Likewise. * elf/reldep.c: New file. * elf/reldep2.c: New file. * elf/reldep3.c: New file. * elf/reldepmod1.c: New file. * elf/reldepmod2.c: New file. * elf/reldepmod3.c: New file. * elf/reldepmod4.c: New file. * elf/unload.c: New file. * elf/unloadmod.c: New file. * elf/do-lookup.h: Remove unused undef_name parameter. * elf/dl-lookup.c: Adjust callers.
2000-08-27 01:41:19 +02:00
map->l_local_scope, &vers, 0, 1);
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
}
if (ref != NULL)
Update. 2000-05-05 Ulrich Drepper <drepper@redhat.com> * elf/dl-load.c (_dl_map_object_from_fd): Little of computation of parameter to mprotect and for variable assignments. 2000-05-03 Jes Sorensen <jes@linuxcare.com> * sysdeps/generic/ldsodefs.h (LOOKUP_VALUE_ADDRESS): Check the validity of map before dereferencing it. * elf/dl-reloc.c (RESOLVE_MAP): Define. 2000-05-02 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Add the value returned in the symbol lookup to the arguments to elf_machine_fixup_plt(). * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Add Link_map of the symbol being resolved to input argument list and make the function return the pointer to the reloc. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Change return valuie to lookup_t and return the value. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/dl-machine.h (elf_machine_fixup_plt): Likewise. Make it an inline function returning value after calling __elf_machine_fixup_plt(). * elf/dl-sym.c (_dl_vsym): Use DL_SYMBOL_ADDRESS() to obtain the symbol address. * elf/dl-symbol.c (_dl_symbol_value): Use LOOKUP_VALUE_ADDRESS to obtain the symbol address. * sysdeps/generic/ldsodefs.h: Add generic DL_SYMBOL_ADDRESS() macro depending on the definition of ELF_FUNCTION_PTR_IS_SPECIAL. * sysdeps/ia64/dl-machine.h: Add DL_SYMBOL_ADDRESS() macro calling _dl_symbol_address() - this way DL_SYMBOL_ADDRESS() turns into an inline on non ia64. 2000-04-28 Jes Sorensen <jes@linuxcare.com> * elf/dl-runtime.c (fixup): Use the portable macros to get the symbol address of an object. * elf/dl-runtime.c (fixup-profile): Use the portable macros to get the symbol address of an object. * elf/dl-libc.c (struct do_dlsym_args): Change loadbase to a lookup_t. * elf/dl-lookup.c (_dl_lookup_symbol): Likewise. (_dl_lookup_symbol_skip): Likewise. (_dl_lookup_versioned_symbol): Likewise. (_dl_lookup_versioned_symbol_skip): Likewise. 2000-04-27 Jes Sorensen <jes@linuxcare.com> * elf/rtld.c (_dl_start): Get the function pointer return address via _dl_start_address for architectures that need a function pointer descriptor rather than just a pointer (ia64). * sysdeps/generic/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-lookupcfg.h: New file. * sysdeps/ia64/dl-machine.h: New file. * sysdeps/ia64/dl-symaddr.c: New file. * sysdeps/ia64/dl-fptr.c: New file. * elf/elf.h: Add IA-64 specific definitions.
2000-05-05 09:15:29 +02:00
return DL_SYMBOL_ADDRESS (result, ref);
Update. * sysdeps/gnu/Makefile (libdl-routines): Add eval. 1999-07-06 Zack Weinberg <zack@rabi.columbia.edu> * dlfcn: New directory. Move the following files from elf: dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c, dlopenold.c, dlsym.c, dlvsym.c. * dlfcn/Makefile: New file. * dlfcn/Versions: New file. * dlfcn/dlsym.c: All ELF-specific code split out to new function _dl_sym. * dlfcn/dlvsym.c: All ELF-specific code split out to new function _dl_vsym. * elf/dl-sym.c: New file. _dl_sym and _dl_vsym are implemented here. * dlfcn/dladdr.c: Remove all references to ELF data structures or headers. * dlfcn/dlclose.c: Likewise. * dlfcn/dlerror.c: Likewise. * dlfcn/dlopen.c: Likewise. * dlfcn/dlopenold.c: Likewise. * Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is yes, empty otherwise. (libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes, depending on build-shared. (subdirs): Add $(dlfcn). (rpath-dirs): Add dlfcn. * elf/Makefile: Remove all references to libdl or its components, except the ones relating to the test cases. (routines): Add dl-sym. * elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2. (libdl): Delete. * elf/dl-close.c (_dl_close): Change argument to void *. * elf/dl-open.c (_dl_open): Change return type to void *. * elf/eval.c: Removed. * elf/ldsodefs.h: Move prototypes of _dl_catch_error, _dlerror_run, _dl_open, _dl_close, _dl_addr, and _dl_mcount_wrapper_check to include/dlfcn.h. Delete _CALL_DL_FCT macro. * include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here. Include real header from dlfcn directory. * include/ldsodefs.h: Removed. * grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * iconv/gconv.c: Likewise. Don't include ldsodefs.h. * iconv/gconv_db.c: Likewise. Don't include ldsodefs.h. * iconv/skeleton.c: Don't include ldsodefs.h. * nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h. 1999-07-07 Ulrich Drepper <drepper@cygnus.com>
1999-07-07 20:39:33 +02:00
return NULL;
}