MFC: Don't panic if a corrupted kld doesn't have a valid symbol table.

This commit is contained in:
jhb 2005-11-08 16:00:42 +00:00
parent 32326c2058
commit 07fb0314c7

View File

@ -1019,6 +1019,12 @@ link_elf_lookup_symbol(linker_file_t lf, const char* name, c_linker_sym_t* sym)
unsigned long hash;
int i;
/* If we don't have a hash, bail. */
if (ef->buckets == NULL || ef->nbuckets == 0) {
printf("link_elf_lookup_symbol: missing symbol hash table\n");
return ENOENT;
}
/* First, search hashed global symbols */
hash = elf_hash(name);
symnum = ef->buckets[hash % ef->nbuckets];