about summary refs log tree commit diff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-01-10 18:00:55 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-06 16:19:35 -0300
commit0f4254311ebf15b8f3f6f66182e8dd5151a58a88 (patch)
tree9a03470d7c7ec394b35cecaf2e1b57a7e8dc08cc /sysdeps/powerpc
parent2a8867a17ffe5c5a4251fd40bf6c73a3fd426062 (diff)
downloadglibc-0f4254311ebf15b8f3f6f66182e8dd5151a58a88.tar.gz
glibc-0f4254311ebf15b8f3f6f66182e8dd5151a58a88.tar.xz
glibc-0f4254311ebf15b8f3f6f66182e8dd5151a58a88.zip
string: Improve generic strnlen with memchr
It also cleanups the multiple inclusion by leaving the ifunc
implementation to undef the weak_alias and libc_hidden_def.

Co-authored-by: Richard Henderson  <richard.henderson@linaro.org>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c
index 957b9b99e8..2ca1cd7181 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/strnlen-ppc32.c
@@ -17,12 +17,12 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define STRNLEN  __strnlen_ppc
+#include <string/strnlen.c>
+
 #ifdef SHARED
-# undef libc_hidden_def
-# define libc_hidden_def(name)  \
-    __hidden_ver1 (__strnlen_ppc, __GI_strnlen, __strnlen_ppc); \
-    strong_alias (__strnlen_ppc, __strnlen_ppc_1); \
-    __hidden_ver1 (__strnlen_ppc_1, __GI___strnlen, __strnlen_ppc_1);
+/* Alias for internal symbol to avoid PLT generation, it redirects the
+   libc_hidden_def (__strnlen/strlen) to default implementation.  */
+__hidden_ver1 (__strnlen_ppc, __GI_strnlen, __strnlen_ppc); \
+strong_alias (__strnlen_ppc, __strnlen_ppc_1); \
+__hidden_ver1 (__strnlen_ppc_1, __GI___strnlen, __strnlen_ppc_1);
 #endif
-
-#include <string/strnlen.c>