[PATCH v5 0/2] Update ifunc resolver interface

Yury Khrustalev yury.khrustalev@arm.com
Mon Apr 28 11:32:18 GMT 2025


Support extending ifunc resolver interface with extra HWCAP fields.

Corresponding ABI spec update: https://github.com/ARM-software/abi-aa/pull/320

This patch adds helper function that allows accessing HWCAP elements
through the parameters passed to an ifunc resolver in a portable way.

Regression tested on AArch64 and no regressions have been found.

OK for trunk?

base commit: 77930e0447

Changes in v5:
 - Fixed bug in the helper function.
 - Added tests for the helper function.
 - Dropped commit that would incorrectly initialise arg for
   resovler functions.
 - Dropped enum for HWCAP elements IDs.
Link to v4:
https://inbox.sourceware.org/libc-alpha/20250425113522.3310684-1-yury.khrustalev@arm.com/

Changes in v4:
 - Revert to using fields in the __ifunc_arg_t struct.
 - Update prototype of the ifunc resolver to use pointer to uint64_t
   rather than pointer to the __ifunc_arg_t struct. Note that this
   prototype is backward-compatible with the previous version.
 - Add helper function to access HWCAP elements in a portable way.
Link to v3:
https://inbox.sourceware.org/libc-alpha/20250422124322.3056938-1-yury.khrustalev@arm.com/

Changes in v3:
 - Instead of adding new fields to __ifunc_arg_t introduce a union
   to allow further seamless extension and at the same time letting
   existing code compile without change.
Link to v2:
https://inbox.sourceware.org/libc-alpha/20250404141511.1767584-1-yury.khrustalev@arm.com/

Changes in v2:
 - Expanded comment in <sys/ifunc.h> to explain how to use the _size
   field to check the version of the contents of the __ifunc_arg_t
   struct.
Link to v1:
https://inbox.sourceware.org/libc-alpha/20250401141851.129625-1-yury.khrustalev@arm.com/
---

Yury Khrustalev (2):
  aarch64: add support for hwcap3,4
  aarch64: helper function to access hwcap elements in ifunc resolver

 sysdeps/aarch64/Makefile          |  2 +-
 sysdeps/aarch64/dl-irel.h         | 18 +++++-
 sysdeps/aarch64/sys/ifunc.h       | 58 ++++++++++++++++--
 sysdeps/aarch64/tst-ifunc-arg-1.c | 15 +++++
 sysdeps/aarch64/tst-ifunc-arg-2.c | 14 +++++
 sysdeps/aarch64/tst-ifunc-arg-3.c | 97 +++++++++++++++++++++++++++++++
 6 files changed, 195 insertions(+), 9 deletions(-)
 create mode 100644 sysdeps/aarch64/tst-ifunc-arg-3.c

-- 
2.39.5



More information about the Libc-alpha mailing list