Adjust all callers of _dl_lookup_symbol and _dl_lookup_versioned_symbol.

This commit is contained in:
Ulrich Drepper 2002-04-13 16:04:45 +00:00
parent d83a43e9af
commit 395bae2fdc
5 changed files with 23 additions and 15 deletions

View File

@ -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 <zack@rabi.columbia.edu>, 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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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 <kkojima@info.kanagawa-u.ac.jp>.
@ -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 \