[PATCH] arm: Redirect memcpy to __memcpy_arm for loader/static init code

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Jun 1 15:54:36 GMT 2026


After "elf: Initialize TCB and stack-protector before static IFUNC
resolvers (BZ 20680, BZ 27582, BZ 28817)", early loader and static
initialization code may run before the IFUNC resolvers are processed.

The armv7-a supports memcpy, so add a dl-symbol-redir-ifunc.h to
redirect the memcpy to to __memcpy_arm implementation.

Checked on armv7a-linux-gnueabihf.
---
 .../armv7/multiarch/dl-symbol-redir-ifunc.h   | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 sysdeps/arm/armv7/multiarch/dl-symbol-redir-ifunc.h

diff --git a/sysdeps/arm/armv7/multiarch/dl-symbol-redir-ifunc.h b/sysdeps/arm/armv7/multiarch/dl-symbol-redir-ifunc.h
new file mode 100644
index 00000000000..63fe46f077c
--- /dev/null
+++ b/sysdeps/arm/armv7/multiarch/dl-symbol-redir-ifunc.h
@@ -0,0 +1,24 @@
+/* Symbol redirection for loader/static initialization code.
+   Copyright (C) 2026 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _DL_IFUNC_GENERIC_H
+#define _DL_IFUNC_GENERIC_H
+
+asm ("memcpy = __memcpy_arm");
+
+#endif
-- 
2.43.0



More information about the Libc-alpha mailing list