mirror of git://sourceware.org/git/glibc.git
Remove unnecessarily nested function in do_lookup_unique.
This commit is contained in:
parent
f7b425175c
commit
7b8fb2b8db
|
@ -1,3 +1,9 @@
|
||||||
|
2014-10-08 Kostya Serebryany <konstantin.s.serebryany@gmail.com>
|
||||||
|
Roland McGrath <roland@hack.frob.com>
|
||||||
|
|
||||||
|
* elf/dl-lookup.c (enter_unique_sym): New function, broken out of ...
|
||||||
|
(do_lookup_unique): ... local function 'enter' here; update callers.
|
||||||
|
|
||||||
2014-10-06 Joseph Myers <joseph@codesourcery.com>
|
2014-10-06 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Condition
|
* sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Condition
|
||||||
|
|
|
@ -182,20 +182,9 @@ check_match (const char *const undef_name,
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Utility function for do_lookup_x. Lookup an STB_GNU_UNIQUE symbol
|
/* Utility function for do_lookup_unique. Add a symbol to TABLE. */
|
||||||
in the unique symbol table, creating a new entry if necessary.
|
|
||||||
Return the matching symbol in RESULT. */
|
|
||||||
static void
|
static void
|
||||||
do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
|
enter_unique_sym (struct unique_sym *table, size_t size,
|
||||||
const struct link_map *map, struct sym_val *result,
|
|
||||||
int type_class, const ElfW(Sym) *sym, const char *strtab,
|
|
||||||
const ElfW(Sym) *ref, const struct link_map *undef_map)
|
|
||||||
{
|
|
||||||
/* We have to determine whether we already found a
|
|
||||||
symbol with this name before. If not then we have to
|
|
||||||
add it to the search table. If we already found a
|
|
||||||
definition we have to use it. */
|
|
||||||
void enter (struct unique_sym *table, size_t size,
|
|
||||||
unsigned int hash, const char *name,
|
unsigned int hash, const char *name,
|
||||||
const ElfW(Sym) *sym, const struct link_map *map)
|
const ElfW(Sym) *sym, const struct link_map *map)
|
||||||
{
|
{
|
||||||
|
@ -214,6 +203,19 @@ do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
|
||||||
table[idx].map = map;
|
table[idx].map = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Utility function for do_lookup_x. Lookup an STB_GNU_UNIQUE symbol
|
||||||
|
in the unique symbol table, creating a new entry if necessary.
|
||||||
|
Return the matching symbol in RESULT. */
|
||||||
|
static void
|
||||||
|
do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
|
||||||
|
const struct link_map *map, struct sym_val *result,
|
||||||
|
int type_class, const ElfW(Sym) *sym, const char *strtab,
|
||||||
|
const ElfW(Sym) *ref, const struct link_map *undef_map)
|
||||||
|
{
|
||||||
|
/* We have to determine whether we already found a symbol with this
|
||||||
|
name before. If not then we have to add it to the search table.
|
||||||
|
If we already found a definition we have to use it. */
|
||||||
|
|
||||||
struct unique_sym_table *tab
|
struct unique_sym_table *tab
|
||||||
= &GL(dl_ns)[map->l_ns]._ns_unique_sym_table;
|
= &GL(dl_ns)[map->l_ns]._ns_unique_sym_table;
|
||||||
|
|
||||||
|
@ -274,7 +276,7 @@ do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
|
||||||
|
|
||||||
for (idx = 0; idx < size; ++idx)
|
for (idx = 0; idx < size; ++idx)
|
||||||
if (entries[idx].name != NULL)
|
if (entries[idx].name != NULL)
|
||||||
enter (newentries, newsize, entries[idx].hashval,
|
enter_unique_sym (newentries, newsize, entries[idx].hashval,
|
||||||
entries[idx].name, entries[idx].sym,
|
entries[idx].name, entries[idx].sym,
|
||||||
entries[idx].map);
|
entries[idx].map);
|
||||||
|
|
||||||
|
@ -317,11 +319,12 @@ do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
|
if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
|
||||||
enter (entries, size, new_hash, strtab + sym->st_name, ref,
|
enter_unique_sym (entries, size, new_hash, strtab + sym->st_name, ref,
|
||||||
undef_map);
|
undef_map);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
enter (entries, size, new_hash, strtab + sym->st_name, sym, map);
|
enter_unique_sym (entries, size,
|
||||||
|
new_hash, strtab + sym->st_name, sym, map);
|
||||||
|
|
||||||
if (map->l_type == lt_loaded)
|
if (map->l_type == lt_loaded)
|
||||||
/* Make sure we don't unload this object by
|
/* Make sure we don't unload this object by
|
||||||
|
|
Loading…
Reference in New Issue