Skip to content

Commit 0886bb7

Browse files
committed
[ELFLOADER] Added support for IFUNC in PltResolver
1 parent fa14e0a commit 0886bb7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/elfs/elfloader.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,6 +2076,11 @@ EXPORT void PltResolver(x86emu_t* emu)
20762076
printf_dump(LOG_DEBUG, "symbol %s from %s but elf not initialized yet, run Init now (from %s)\n", symname, ElfName(sym_elf), ElfName(h));
20772077
RunElfInitPltResolver(sym_elf, emu);
20782078
}
2079+
if(sym && (sym->st_info&0xf)==STT_GNU_IFUNC) {
2080+
// this is an IFUNC, needs to evaluate the function first!
2081+
printf_dump(LOG_DEBUG, " Indirect function, will call the resolver now at %p\n", (void*)offs);
2082+
offs = RunFunction(offs, 0);
2083+
}
20792084
offs = (uintptr_t)getAlternate((void*)offs);
20802085

20812086
if(p) {

0 commit comments

Comments
 (0)