libdyld: handle existing but undefined symbols during lookup.

This commit is contained in:
whitequark 2015-08-02 05:49:15 +03:00
parent 36e03ec8a8
commit 6a1b0b342c

View file

@ -171,5 +171,9 @@ void *dyld_lookup(const char *symbol, struct dyld_info *info) {
index = info->hash.chain[index]; 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;
} }