Does IFunc use from LLVM require OS support?

I only know implementations in glibc and FreeBSD rtld, and Android bionic.

For a portable alternative, use a (global) function pointer:

Using a global function pointer offers more flexibility:

  • It can be initialized at any appropriate time. The relocation resolving time ifunc is subject to static initialization order fiasco.
  • The resolver can have custom arguments, not the fixed ones provided by the dynamic loader.
3 Likes