aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2005-10-31 19:17:32 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2005-10-31 19:17:32 +0000
commitf6494f2e1360cb4509afbbb2efbe329bfbe8ec4b (patch)
treee612d48f50d014f91c24f77c5d054df4f6c3971f /sys/kern/link_elf.c
parentaa14e8f4b4531464d90f83e00633888439fdd1ea (diff)
Notes
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 19317ed3bd3d..29b54e51d245 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -1022,6 +1022,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];