From 6a1b0b342c9e9c94f36a27550ea1ba8aee1c8ed8 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 2 Aug 2015 05:49:15 +0300 Subject: [PATCH] libdyld: handle existing but undefined symbols during lookup. --- software/libdyld/dyld.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/software/libdyld/dyld.c b/software/libdyld/dyld.c index 112f2e04..da531b6d 100644 --- a/software/libdyld/dyld.c +++ b/software/libdyld/dyld.c @@ -171,5 +171,9 @@ void *dyld_lookup(const char *symbol, struct dyld_info *info) { index = info->hash.chain[index]; } - return (void*)(info->base + info->symtab[index].st_value); + Elf32_Addr value = info->symtab[index].st_value; + if(value != 0) + return (void*)(info->base + value); + else + return NULL; } -- 2.30.2