static inline int
do_lookup (const char *undef_name, unsigned long int hash,
const ElfW(Sym) *ref, struct sym_val *result,
- struct link_map *list[], size_t i, size_t n,
- const char *reference_name, const struct r_found_version *version,
- struct link_map *skip, int reloc_type)
+ struct link_map *scope, size_t i, const char *reference_name,
+ const struct r_found_version *version, struct link_map *skip,
+ int reloc_type)
{
+ struct link_map **list = scope->l_searchlist;
+ size_t n = scope->l_nsearchlist;
struct link_map *map;
for (; i < n; ++i)
if (map->l_info[DT_SYMTAB] == NULL)
continue;
+ /* Print some debugging info if wanted. */
+ if (_dl_debug_symbols)
+ _dl_debug_message ("\tsymbol=", undef_name, "; lookup in file=",
+ map->l_name[0] ? map->l_name : _dl_argv[0],
+ "\n", NULL);
+
symtab = ((void *) map->l_addr + map->l_info[DT_SYMTAB]->d_un.d_ptr);
strtab = ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
verstab = map->l_versyms;
/* Search the relevant loaded objects for a definition. */
for (scope = symbol_scope; *scope; ++scope)
if (do_lookup (undef_name, hash, *ref, ¤t_value,
- (*scope)->l_searchlist, 0, (*scope)->l_nsearchlist,
- reference_name, NULL, NULL, reloc_type))
+ *scope, 0, reference_name, NULL, NULL, reloc_type))
break;
if (current_value.s == NULL)
assert (i < (*scope)->l_ndupsearchlist);
if (! do_lookup (undef_name, hash, *ref, ¤t_value,
- (*scope)->l_dupsearchlist, i, (*scope)->l_ndupsearchlist,
- reference_name, NULL, skip_map, 0))
+ *scope, i, reference_name, NULL, skip_map, 0))
while (*++scope)
if (do_lookup (undef_name, hash, *ref, ¤t_value,
- (*scope)->l_dupsearchlist, 0, (*scope)->l_ndupsearchlist,
- reference_name, NULL, skip_map, 0))
+ *scope, 0, reference_name, NULL, skip_map, 0))
break;
if (current_value.s == NULL)
for (scope = symbol_scope; *scope; ++scope)
{
int res = do_lookup (undef_name, hash, *ref, ¤t_value,
- (*scope)->l_searchlist, 0, (*scope)->l_nsearchlist,
- reference_name, version, NULL, reloc_type);
+ *scope, 0, reference_name, version, NULL, reloc_type);
if (res > 0)
break;
assert (i < (*scope)->l_ndupsearchlist);
if (! do_lookup (undef_name, hash, *ref, ¤t_value,
- (*scope)->l_dupsearchlist, i, (*scope)->l_ndupsearchlist,
- reference_name, version, skip_map, 0))
+ *scope, i, reference_name, version, skip_map, 0))
while (*++scope)
if (do_lookup (undef_name, hash, *ref, ¤t_value,
- (*scope)->l_dupsearchlist, 0, (*scope)->l_ndupsearchlist,
- reference_name, version, skip_map, 0))
+ *scope, 0, reference_name, version, skip_map, 0))
break;
if (current_value.s == NULL)
int _dl_debug_libs;
int _dl_debug_impcalls;
int _dl_debug_bindings;
+int _dl_debug_symbols;
/* Set nonzero during loading and initialization of executable and
libraries, cleared before the executable's entry point runs. This
any_debug = 1;
dl_debug += 8;
}
- if (strncmp (dl_debug, "libs", 4) == 0
+ else if (strncmp (dl_debug, "libs", 4) == 0
&& (issep (dl_debug[4]) || dl_debug[4] == '\0'))
{
_dl_debug_libs = 1;
bindings display information about symbol binding\n\
help display this help message and exit\n\
libs display library search paths\n\
+ symbols display symbol table processing\n\
\n\
To direct the debugging output into a file instead of standard output\n\
a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\n",
NULL);
_exit (0);
}
+ else if (strncmp (dl_debug, "symbols", 7) == 0
+ && (issep (dl_debug[7]) || dl_debug[7] == '\0'))
+ {
+ _dl_debug_symbols = 1;
+ _dl_debug_impcalls = 1;
+ any_debug = 1;
+ dl_debug += 7;
+ }
else
/* Skip everything until next separator. */
do