[PATCH v4 0/1] aarch64: Add ifuncs for malloc functions

Yury Khrustalev yury.khrustalev@arm.com
Mon Jun 1 10:30:33 GMT 2026


See commit message for details. In a nutshell, we want to add ifuncs
for the functions related to the malloc API (on targets that support
ifuncs). This will allow to add alternative (e.g. target-specific)
implementations or wrappers for these functions.

This patch introduces ifuncs for malloc functions for aarch64 in
multiarch mode.

Changes in v4:
 - Replaced custom ifunc macros with the one from libc-symbols.h.
 - v3: https://inbox.sourceware.org/libc-alpha/20260531161322.2610706-1-yury.khrustalev@arm.com

Changes in v3:
 - Moved all ifunc code into multiarch folder under aarch64, so this
   change is now aarch64-only not affecting other targets.
 - v2: https://inbox.sourceware.org/libc-alpha/20260420141459.531612-1-yury.khrustalev@arm.com

Changes in v2:
 - Fixed ifunc resolvers arguments: use no arguments for generic resolvers
   and use 'uint64_t arg0, uint64_t arg1[]' for aarch64 resolvers.
 - Added grep test to check that code in malloc.c doesn't use non-_core
   functions.
 - Cleaned-up makefile patch.

---
base-commit: 7d213541cb

Passes regression on aarch64, OK for trunk?
---

Yury Khrustalev (1):
  malloc: aarch64: Add ifuncs for malloc functions

 malloc/malloc-internal.h                  |  3 +
 malloc/malloc.c                           | 42 +++++++++++--
 sysdeps/aarch64/multiarch/Makefile        | 10 +++-
 sysdeps/aarch64/multiarch/malloc-ifuncs.c | 73 +++++++++++++++++++++++
 sysdeps/aarch64/multiarch/malloc-ifuncs.h | 61 +++++++++++++++++++
 sysdeps/generic/malloc-ifuncs.h           | 37 ++++++++++++
 6 files changed, 218 insertions(+), 8 deletions(-)
 create mode 100644 sysdeps/aarch64/multiarch/malloc-ifuncs.c
 create mode 100644 sysdeps/aarch64/multiarch/malloc-ifuncs.h
 create mode 100644 sysdeps/generic/malloc-ifuncs.h

-- 
2.47.3



More information about the Libc-alpha mailing list