aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386
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/i386
parent2a8867a17ffe5c5a4251fd40bf6c73a3fd426062 (diff)
downloadglibc-0f4254311ebf15b8f3f6f66182e8dd5151a58a88.tar
glibc-0f4254311ebf15b8f3f6f66182e8dd5151a58a88.tar.gz
glibc-0f4254311ebf15b8f3f6f66182e8dd5151a58a88.tar.bz2
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/i386')
-rw-r--r--sysdeps/i386/i686/multiarch/strnlen-c.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdeps/i386/i686/multiarch/strnlen-c.c b/sysdeps/i386/i686/multiarch/strnlen-c.c
index 351e939a93..beb0350d53 100644
--- a/sysdeps/i386/i686/multiarch/strnlen-c.c
+++ b/sysdeps/i386/i686/multiarch/strnlen-c.c
@@ -1,10 +1,10 @@
#define STRNLEN __strnlen_ia32
+#include <string/strnlen.c>
+
#ifdef SHARED
-# undef libc_hidden_def
-# define libc_hidden_def(name) \
- __hidden_ver1 (__strnlen_ia32, __GI_strnlen, __strnlen_ia32); \
- strong_alias (__strnlen_ia32, __strnlen_ia32_1); \
- __hidden_ver1 (__strnlen_ia32_1, __GI___strnlen, __strnlen_ia32_1);
+/* Alias for internal symbol to avoid PLT generation, it redirects the
+ libc_hidden_def (__strnlen/strlen) to default implementation. */
+__hidden_ver1 (__strnlen_ia32, __GI_strnlen, __strnlen_ia32);
+strong_alias (__strnlen_ia32, __strnlen_ia32_1);
+__hidden_ver1 (__strnlen_ia32_1, __GI___strnlen, __strnlen_ia32_1);
#endif
-
-#include "string/strnlen.c"