FWIW it turns out that IFUNC resolution is supported by gcc for riscv targets where all the underlying tools support them (which, in current riscv-gnu-toolchain, they do). Support is detected and enabled here: https://github.com/gcc-mirror/gcc/blob/master/gcc/configure.ac#L3027 Having a stable finalised kernel/user interface for caps would help, but for this purpose a few CSR reads should hopefully be enough to make sane decisions.