[PATCH 0/2] malloc: introduce ifuncs for malloc functions

Yury Khrustalev yury.khrustalev@arm.com
Thu Apr 16 09:27:49 GMT 2026


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

The following aspects have been considered:

1) Generic resolvers that return core implementations. These will be
   used for most targets that don't provide their custome resolvers.

2) Allow targets to provide their own resolvers (e.g. aarch64 may use
   this to implement resolvers that return memory tagging implementations
   when this is supported and requested).

3) For the targets without ifunc support there is no functional change.

Passes regression on aarch64 and x86-64 and has been build-tested using
the build-many-glibcs script for various targets including those without
ifunc support. OK for trunk?

---
base-commit: 02d9614158
---

Yury Khrustalev (2):
  misc: fix lint-makefiles failures
  malloc: introduce ifuncs for malloc functions

 malloc/malloc.c                 | 119 ++++++++++++++++++--------------
 sysdeps/aarch64/Makefile        |  42 ++++++++---
 sysdeps/aarch64/malloc-ifuncs.c |  85 +++++++++++++++++++++++
 sysdeps/generic/Makefile        |  27 ++++++--
 sysdeps/generic/malloc-ifuncs.c |  94 +++++++++++++++++++++++++
 sysdeps/generic/malloc-ifuncs.h |  62 +++++++++++++++++
 6 files changed, 362 insertions(+), 67 deletions(-)
 create mode 100644 sysdeps/aarch64/malloc-ifuncs.c
 create mode 100644 sysdeps/generic/malloc-ifuncs.c
 create mode 100644 sysdeps/generic/malloc-ifuncs.h

-- 
2.47.3



More information about the Libc-alpha mailing list