diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/linker/linker.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/linker/linker.c b/src/linker/linker.c index 25b1b3d..b5b782d 100644 --- a/src/linker/linker.c +++ b/src/linker/linker.c @@ -1384,9 +1384,10 @@ static int apkenv_reloc_library(soinfo *si, Elf32_Rel *rel, unsigned count) } if(sym_addr != 0) { - if(ELF32_ST_TYPE(((Elf32_Sym*)(intptr_t)sym_addr)->st_info) == STT_FUNC) { + Dl_info info; + ElfW(Sym) *extra; + if (dladdr1((void*)sym_addr, &info, (void**) &extra, RTLD_DL_SYMENT) && extra && ELF32_ST_TYPE(extra->st_info) == STT_FUNC) sym_addr = (unsigned)wrapper_create(sym_name, (void*)sym_addr); - } } else if(s == NULL) { /* We only allow an undefined symbol if this is a weak |