[PATCH v9 5/6] riscv: Add ifunc helper method to hwprobe.h
Florian Weimer
fweimer@redhat.com
Thu Dec 7 09:46:51 GMT 2023
> specifically, my anecdata from Android [both open-source libraries and
> apps] is that basically no-one uses ifuncs beyond libc and
> compiler-generated fmv ifuncs [though for riscv64 that's still "future
> work"], so there's no market for helpers for hand-written ifuncs?
It used to be more widely used on GNU/Linux, for example:
implemented enabling sized-delete support at runtime
Under gcc 4.5 or greater we're using ifunc function attribute to
resolve sized delete operator to either plain delete implementation
(default) or to sized delete (if enabled via environment variable
TCMALLOC_ENABLE_SIZED_DELETE).
<https://github.com/gperftools/gperftools/commit/6fdfc5a7f40ebcff3fdaada1a2994ff54be2f9c7>
After distributions turned on BIND_NOW, using IFUNCs for purposes like
that became much more difficult. We are getting closer to re-enabling
getenv for use in IFUNC resolvers if the ELF dependencies express a
usable relocatoion order, but until my delayed IFUNC resolution patch is
accepted, IFUNC resolvers won't interoperate will with symbol
interposition or underlinking, so compatibility problems remain.
Outside GCC and glibc, I only see an IFUNC resolver in zlib (which is
known to be problematic because it's a frequently interposed library,
and it will go away with the switch to zlib-ng), and nauty
<https://pallini.di.uniroma1.it/>. I don't know how that was produced.
I do not evidence of other uses for global symbols, neither from
function multi-versioning nor from manually written clones. (There
might be some additional use in the form of IRELATIVE relocations.)
Thanks,
Florian
More information about the Libc-alpha
mailing list