From 395bae2fdc69f52a990fa09a9da392d053532155 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 13 Apr 2002 16:04:45 +0000 Subject: [PATCH] Adjust all callers of _dl_lookup_symbol and _dl_lookup_versioned_symbol. --- elf/dl-libc.c | 5 +++-- elf/dl-reloc.c | 8 +++++--- elf/dl-runtime.c | 8 +++++--- elf/dl-sym.c | 12 +++++++----- sysdeps/mips/dl-machine.h | 5 +++-- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/elf/dl-libc.c b/elf/dl-libc.c index c83448df77c..fd3ee727ba3 100644 --- a/elf/dl-libc.c +++ b/elf/dl-libc.c @@ -1,5 +1,5 @@ /* Handle loading and unloading shared objects for internal libc purposes. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Zack Weinberg , 1999. @@ -84,7 +84,8 @@ do_dlsym (void *ptr) struct do_dlsym_args *args = (struct do_dlsym_args *) ptr; args->ref = NULL; args->loadbase = _dl_lookup_symbol (args->name, args->map, &args->ref, - args->map->l_local_scope, 0, 1); + args->map->l_local_scope, 0, + DL_LOOKUP_RETURN_NEWEST); } static void diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index 2328330f457..f9c31356beb 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -1,5 +1,5 @@ /* Relocate a shared object and resolve its references to other loaded objects. - Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -126,7 +126,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], l, (ref), scope, \ (version), _tc, 0) \ : _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \ - scope, _tc, 0)); \ + scope, _tc, \ + DL_LOOKUP_ADD_DEPENDENCY)); \ l->l_lookup_cache.ret = (*ref); \ l->l_lookup_cache.value = _lr; })) \ : l) @@ -146,7 +147,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], l, (ref), scope, \ (version), _tc, 0) \ : _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \ - scope, _tc, 0)); \ + scope, _tc, \ + DL_LOOKUP_ADD_DEPENDENCY)); \ l->l_lookup_cache.ret = (*ref); \ l->l_lookup_cache.value = _lr; })) \ : l->l_addr) diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c index 2f5832426b8..b8aa725aa24 100644 --- a/elf/dl-runtime.c +++ b/elf/dl-runtime.c @@ -1,5 +1,5 @@ /* On-demand PLT fixup for shared objects. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -95,7 +95,8 @@ fixup ( } case 0: result = _dl_lookup_symbol (strtab + sym->st_name, l, &sym, - l->l_scope, ELF_RTYPE_CLASS_PLT, 0); + l->l_scope, ELF_RTYPE_CLASS_PLT, + DL_LOOKUP_ADD_DEPENDENCY); } /* Currently result contains the base load address (or link map) @@ -188,7 +189,8 @@ profile_fixup ( } case 0: result = _dl_lookup_symbol (strtab + sym->st_name, l, &sym, - l->l_scope, ELF_RTYPE_CLASS_PLT, 0); + l->l_scope, ELF_RTYPE_CLASS_PLT, + DL_LOOKUP_ADD_DEPENDENCY); } /* Currently result contains the base load address (or link map) diff --git a/elf/dl-sym.c b/elf/dl-sym.c index 85d084f7f70..16d73ef1520 100644 --- a/elf/dl-sym.c +++ b/elf/dl-sym.c @@ -1,5 +1,5 @@ /* Look up a symbol in a shared object loaded by `dlopen'. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -51,7 +51,9 @@ _dl_sym (void *handle, const char *name, void *who) 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); + result = _dl_lookup_symbol (name, match, &ref, match->l_scope, 0, + DL_LOOKUP_RETURN_NEWEST + | DL_LOOKUP_ADD_DEPENDENCY); else { if (handle != RTLD_NEXT) @@ -60,7 +62,7 @@ _dl_sym (void *handle, const char *name, void *who) struct link_map *map = handle; result = _dl_lookup_symbol (name, match, &ref, map->l_local_scope, - 0, 1); + 0, DL_LOOKUP_RETURN_NEWEST); } else { @@ -123,7 +125,7 @@ _dl_vsym (void *handle, const char *name, const char *version, void *who) if (handle == RTLD_DEFAULT) /* Search the global scope. */ result = _dl_lookup_versioned_symbol (name, match, &ref, match->l_scope, - &vers, 0, 0); + &vers, 0, DL_LOOKUP_ADD_DEPENDENCY); else if (handle == RTLD_NEXT) { if (__builtin_expect (match == _dl_loaded, 0)) @@ -148,7 +150,7 @@ RTLD_NEXT used in code not dynamically loaded")); /* Search the scope of the given object. */ struct link_map *map = handle; result = _dl_lookup_versioned_symbol (name, map, &ref, - map->l_local_scope, &vers, 0, 1); + map->l_local_scope, &vers, 0, 0); } if (ref != NULL) diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index da9a5d3279c..c9c8eb4aea0 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. MIPS version. - Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Kazumoto Kojima . @@ -308,7 +308,8 @@ __dl_runtime_resolve (ElfW(Word) sym_index, \ } \ case 0: \ value = _dl_lookup_symbol (strtab + sym->st_name, l, &sym, \ - l->l_scope, ELF_RTYPE_CLASS_PLT, 0); \ + l->l_scope, ELF_RTYPE_CLASS_PLT, \ + DL_LOOKUP_ADD_DEPENDENCY); \ } \ \ /* Currently value contains the base load address of the object \ -- 2.47.2