aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/s390
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-06 15:05:56 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-08 17:13:58 -0300
commit22999b2f0fb62eed1af4095d062bd1272d6afeb1 (patch)
treecb21ffd0c043cdb5393c3529148b83679349d7a5 /sysdeps/s390
parent7ea510127e2067efa07865158ac92c330c379950 (diff)
downloadglibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.zip
glibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.tar.gz
glibc-22999b2f0fb62eed1af4095d062bd1272d6afeb1.tar.bz2
string: Add libc_hidden_proto for memrchr
Although static linker can optimize it to local call, it follows the internal scheme to provide hidden proto and definitions. Reviewed-by: Carlos Eduardo Seo <carlos.seo@linaro.org>
Diffstat (limited to 'sysdeps/s390')
-rw-r--r--sysdeps/s390/memrchr-c.c4
-rw-r--r--sysdeps/s390/memrchr.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/sysdeps/s390/memrchr-c.c b/sysdeps/s390/memrchr-c.c
index ce97bc6..bdf3c7b 100644
--- a/sysdeps/s390/memrchr-c.c
+++ b/sysdeps/s390/memrchr-c.c
@@ -24,4 +24,8 @@
# endif
# include <string/memrchr.c>
+
+# if defined SHARED && IS_IN (libc)
+__hidden_ver1 (__memrchr_c, __GI___memrchr, __memrchr_c);
+# endif
#endif
diff --git a/sysdeps/s390/memrchr.c b/sysdeps/s390/memrchr.c
index 73e7562..405990f 100644
--- a/sysdeps/s390/memrchr.c
+++ b/sysdeps/s390/memrchr.c
@@ -19,18 +19,20 @@
#include <ifunc-memrchr.h>
#if HAVE_MEMRCHR_IFUNC
+# define __memrchr __redirect_memrchr
# include <string.h>
+# undef __memrchr
# include <ifunc-resolve.h>
# if HAVE_MEMRCHR_C
-extern __typeof (__memrchr) MEMRCHR_C attribute_hidden;
+extern __typeof (__redirect_memrchr) MEMRCHR_C attribute_hidden;
# endif
# if HAVE_MEMRCHR_Z13
-extern __typeof (__memrchr) MEMRCHR_Z13 attribute_hidden;
+extern __typeof (__redirect_memrchr) MEMRCHR_Z13 attribute_hidden;
# endif
-s390_libc_ifunc_expr (__memrchr, __memrchr,
+s390_libc_ifunc_expr (__redirect_memrchr, __memrchr,
(HAVE_MEMRCHR_Z13 && (hwcap & HWCAP_S390_VX))
? MEMRCHR_Z13
: MEMRCHR_DEFAULT