From: whitequark Date: Sun, 2 Aug 2015 02:49:15 +0000 (+0300) Subject: libdyld: handle existing but undefined symbols during lookup. X-Git-Tag: 24jan2021_ls180~2157 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a1b0b342c9e9c94f36a27550ea1ba8aee1c8ed8;p=litex.git libdyld: handle existing but undefined symbols during lookup. --- 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; }