IT lexicon › Programming › IFUNC (GNU indirect function)

IFUNC (GNU indirect function)

Programming På svenska → Updated: 2026-11-07

An ELF symbol type whose address is chosen by a resolver function at load time, so the right implementation is picked once and for all.

The symbol is marked STT_GNU_IFUNC. When the dynamic linker comes to bind it, it calls the resolver instead, which inspects the CPU and returns the address of, say, an AVX2 build of memcpy. From then on calls go through the PLT as usual. The mechanism landed in binutils and glibc in 2009, developed by H. J. Lu at Intel, and it is what function multiversioning is built on.

The resolver runs very early, before the rest of the program has been relocated, and is allowed to do remarkably little. That did not stop the xz backdoor in 2024: it hid inside an IFUNC resolver in liblzma and used it to swap out a function in sshd before anyone was looking.

← Back to the lexicon