summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 19317ed..29b54e5 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];
OpenPOWER on IntegriCloud