Merge "riscv64: pass a null argument to ifunc resolvers." into main am: 95936aec6f

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2684726

Change-Id: I3b481dbe34a96a72a09fa5b2e4d3ea7fbb7d4f18
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Elliott Hughes 2023-08-01 14:51:24 +00:00 committed by Automerger Merge Worker
commit cf530e5d7e

View file

@ -57,6 +57,13 @@ ElfW(Addr) __bionic_call_ifunc_resolver(ElfW(Addr) resolver_addr) {
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)();