2009-07-23 Ulrich Drepper <drepper@redhat.com>
+ * elf/dl-lookup.c (dl_lookup_x): The hashval for unique symbol can
+ potentially be zero.
+
* elf/tst-unique1.c: Extend test to check for unloading DSO with
unique symbol definition.
Patch by Jakub Jelinek.
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;
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;
}
return 1;
}
- if (entries[idx].hashval == 0
- && entries[idx].name == NULL)
+ if (entries[idx].name == NULL)
break;
idx += hash2;
}
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);