aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-lookup.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-07-23 07:36:34 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-23 07:36:34 -0700
commit077e7700b30df967d9000ebe692894fc5d66df80 (patch)
tree79e8781e5ddf99ed2efe5ec9185a65f158420055 /elf/dl-lookup.c
parent802fe9a1ca0577e8eac28c31a8c20497b15e7e69 (diff)
downloadglibc-077e7700b30df967d9000ebe692894fc5d66df80.tar
glibc-077e7700b30df967d9000ebe692894fc5d66df80.tar.gz
glibc-077e7700b30df967d9000ebe692894fc5d66df80.tar.bz2
glibc-077e7700b30df967d9000ebe692894fc5d66df80.zip
Some more fixes for the unique symbol handling.
The hash value can be zero, so we need a different test for empty slots. And unify the way we prevent a DSO from being unloaded.
Diffstat (limited to 'elf/dl-lookup.c')
-rw-r--r--elf/dl-lookup.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index bdc84afa56..1333123b0f 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -318,7 +318,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
size_t hash2 = 1 + hash % (size - 2);
while (1)
{
- if (table[idx].hashval == 0)
+ if (table[idx].name == NULL)
{
table[idx].hashval = hash;
table[idx].name = strtab + sym->st_name;
@@ -336,7 +336,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
if (table[idx].map->l_type == lt_loaded)
/* Make sure we don't unload this object by
artificially increason the open count. */
- ++table[idx].map->l_direct_opencount;
+ table[idx].map->l_flags_1 |= DF_1_NODELETE;
return;
}
@@ -369,8 +369,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
return 1;
}
- if (entries[idx].hashval == 0
- && entries[idx].name == NULL)
+ if (entries[idx].name == NULL)
break;
idx += hash2;
@@ -392,7 +391,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
}
for (idx = 0; idx < size; ++idx)
- if (entries[idx].hashval != 0)
+ if (entries[idx].name != NULL)
enter (newentries, newsize, entries[idx].hashval,
entries[idx].name, entries[idx].sym,
entries[idx].map);