Merge "riscv64: pass a null argument to ifunc resolvers." into main
diff --git a/libc/bionic/bionic_call_ifunc_resolver.cpp b/libc/bionic/bionic_call_ifunc_resolver.cpp
index 437de78..410eb78 100644
--- a/libc/bionic/bionic_call_ifunc_resolver.cpp
+++ b/libc/bionic/bionic_call_ifunc_resolver.cpp
@@ -57,6 +57,13 @@
hwcap = getauxval(AT_HWCAP);
}
return reinterpret_cast<ifunc_resolver_t>(resolver_addr)(hwcap);
+#elif defined(__riscv)
+ // This argument and its value is just a placeholder for now,
+ // but it means that if we do pass something in future (such as
+ // getauxval() and/or hwprobe key/value pairs), callees will be able to
+ // recognize what they're being given.
+ typedef ElfW(Addr) (*ifunc_resolver_t)(void*);
+ return reinterpret_cast<ifunc_resolver_t>(resolver_addr)(nullptr);
#else
typedef ElfW(Addr) (*ifunc_resolver_t)(void);
return reinterpret_cast<ifunc_resolver_t>(resolver_addr)();