summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-12-09 15:22:53 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-09 16:36:05 -0300
commit9d19d878329058e5e2602617ed8cf80d612c1611 (patch)
treeb220cf56a83116ae059d8af43f23c2e4a1a6a6fc
parent9c4b4c1a0a441dcbef1ca825a7d509d7ee0e2f77 (diff)
downloadglibc-9d19d878329058e5e2602617ed8cf80d612c1611.tar.gz
arm: Fix clang multi-arch build with ld.bfd
clang binds autogenerated memcpy/memset/memchr calls to the hidden internal symbols, different than gcc that binds without hidden attribute. And this triggers an linker issue with bfd: ld: BFD (GNU Binutils for Ubuntu) 2.38 assertion fail ../../bfd/elf32-arm.c:4286 Similar to other architectures, bind internal memcpy and memcpy symbols to the generic interface instead.
-rw-r--r--sysdeps/arm/arm-ifunc.h9
-rw-r--r--sysdeps/arm/armv7/multiarch/memchr.c2
-rw-r--r--sysdeps/arm/armv7/multiarch/memchr_noneon.S4
-rw-r--r--sysdeps/arm/armv7/multiarch/memcpy.c2
-rw-r--r--sysdeps/arm/armv7/multiarch/memcpy_arm.S4
5 files changed, 8 insertions, 13 deletions
diff --git a/sysdeps/arm/arm-ifunc.h b/sysdeps/arm/arm-ifunc.h
index 93dbe69183..a000806f96 100644
--- a/sysdeps/arm/arm-ifunc.h
+++ b/sysdeps/arm/arm-ifunc.h
@@ -23,12 +23,3 @@
#define arm_libc_ifunc_redirected(redirected_name, name, expr) \
__ifunc (redirected_name, name, expr(hwcap), int hwcap, INIT_ARCH)
-
-#if defined SHARED
-# define arm_libc_ifunc_hidden_def(redirect_name, name) \
- __hidden_ver1 (name, __GI_##name, redirect_name) \
- __attribute__ ((visibility ("hidden"))) \
- __attribute_copy__ (name)
-#else
-# define arm_libc_ifunc_hidden_def(redirect_name, name)
-#endif
diff --git a/sysdeps/arm/armv7/multiarch/memchr.c b/sysdeps/arm/armv7/multiarch/memchr.c
index 18f88a8762..9e53c4fc7a 100644
--- a/sysdeps/arm/armv7/multiarch/memchr.c
+++ b/sysdeps/arm/armv7/multiarch/memchr.c
@@ -30,6 +30,4 @@
# include "ifunc-memchr.h"
arm_libc_ifunc_redirected (__redirect_memchr, memchr, IFUNC_SELECTOR);
-
-arm_libc_ifunc_hidden_def (__redirect_memchr, memchr);
#endif
diff --git a/sysdeps/arm/armv7/multiarch/memchr_noneon.S b/sysdeps/arm/armv7/multiarch/memchr_noneon.S
index b1fb54018d..982b9f2789 100644
--- a/sysdeps/arm/armv7/multiarch/memchr_noneon.S
+++ b/sysdeps/arm/armv7/multiarch/memchr_noneon.S
@@ -3,3 +3,7 @@
#define libc_hidden_builtin_def(name)
#include <sysdeps/arm/armv6t2/memchr.S>
+
+#if IS_IN (libc) && !defined (__ARM_NEON__)
+strong_alias (__memchr_noneon, __GI_memchr)
+#endif
diff --git a/sysdeps/arm/armv7/multiarch/memcpy.c b/sysdeps/arm/armv7/multiarch/memcpy.c
index cf311fdb3e..af25851cba 100644
--- a/sysdeps/arm/armv7/multiarch/memcpy.c
+++ b/sysdeps/arm/armv7/multiarch/memcpy.c
@@ -30,6 +30,4 @@
# include "ifunc-memcpy.h"
arm_libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR);
-
-arm_libc_ifunc_hidden_def (__redirect_memcpy, memcpy);
#endif
diff --git a/sysdeps/arm/armv7/multiarch/memcpy_arm.S b/sysdeps/arm/armv7/multiarch/memcpy_arm.S
index e4a9a68c42..d71493fdb3 100644
--- a/sysdeps/arm/armv7/multiarch/memcpy_arm.S
+++ b/sysdeps/arm/armv7/multiarch/memcpy_arm.S
@@ -8,3 +8,7 @@
strong_alias (__memcpy_arm, __aeabi_memcpy)
strong_alias (__memcpy_arm, __aeabi_memcpy4)
strong_alias (__memcpy_arm, __aeabi_memcpy8)
+
+#if IS_IN (libc) && !defined (__ARM_NEON__)
+strong_alias (__memcpy_arm, __GI_memcpy)
+#endif