]> git.ipfire.org Git - thirdparty/glibc.git/commit
riscv: Add __riscv_hwprobe pointer to ifunc calls
authorEvan Green <evan@rivosinc.com>
Tue, 27 Feb 2024 22:56:40 +0000 (14:56 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 1 Mar 2024 15:14:58 +0000 (07:14 -0800)
commit78308ce77ad55191d2e578bbcd19bb55c68926cb
treeb3d1d142e10539967b6cc545e4f3c76763a76015
parente7919e0db28837ae5e4315933a061a7c2eda442e
riscv: Add __riscv_hwprobe pointer to ifunc calls

The new __riscv_hwprobe() function is designed to be used by ifunc
selector functions. This presents a challenge for applications and
libraries, as ifunc selectors are invoked before all relocations have
been performed, so an external call to __riscv_hwprobe() from an ifunc
selector won't work. To address this, pass a pointer to the
__riscv_hwprobe() function into ifunc selectors as the second
argument (alongside dl_hwcap, which was already being passed).

Include a typedef as well for convenience, so that ifunc users don't
have to go through contortions to call this routine. Users will need to
remember to check the second argument for NULL, to account for older
glibcs that don't pass the function.

Signed-off-by: Evan Green <evan@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
sysdeps/riscv/dl-irel.h
sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h