From: Noah Goldstein <goldstein.w.n@gmail.com>
To: libc-alpha@sourceware.org
Subject: [PATCH v13 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage
Date: Fri, 22 Oct 2021 16:23:56 -0500 [thread overview]
Message-ID: <20211022212358.2164568-2-goldstein.w.n@gmail.com> (raw)
In-Reply-To: <20211022212358.2164568-1-goldstein.w.n@gmail.com>
No bug.
This commit adds hidden defs for all declarations of __memcmpeq. This
enables usage of __memcmpeq without the PLT for usage internal to
GLIBC.
---
include/string.h | 1 +
string/memcmp.c | 1 +
sysdeps/aarch64/memcmp.S | 1 +
sysdeps/csky/abiv2/memcmp.S | 1 +
sysdeps/i386/i686/memcmp.S | 1 +
sysdeps/i386/i686/multiarch/memcmp-ia32.S | 4 ++++
sysdeps/i386/i686/multiarch/memcmp.c | 1 +
sysdeps/i386/memcmp.S | 1 +
sysdeps/ia64/memcmp.S | 1 +
sysdeps/powerpc/powerpc32/405/memcmp.S | 1 +
sysdeps/powerpc/powerpc32/power4/memcmp.S | 1 +
sysdeps/powerpc/powerpc32/power7/memcmp.S | 1 +
sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 +
sysdeps/powerpc/powerpc64/power4/memcmp.S | 1 +
sysdeps/powerpc/powerpc64/power7/memcmp.S | 1 +
sysdeps/powerpc/powerpc64/power8/memcmp.S | 1 +
sysdeps/s390/memcmp-z900.S | 1 +
sysdeps/s390/memcmp.c | 1 +
sysdeps/sparc/sparc64/memcmp.S | 1 +
sysdeps/x86_64/memcmp.S | 1 +
sysdeps/x86_64/multiarch/memcmp-sse2.S | 3 +++
sysdeps/x86_64/multiarch/memcmp.c | 1 +
22 files changed, 27 insertions(+)
diff --git a/include/string.h b/include/string.h
index 81dab39891..21f641a413 100644
--- a/include/string.h
+++ b/include/string.h
@@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
libc_hidden_proto (__strsep_g)
libc_hidden_proto (strnlen)
libc_hidden_proto (__strnlen)
+libc_hidden_proto (__memcmpeq)
libc_hidden_proto (memmem)
extern __typeof (memmem) __memmem;
libc_hidden_proto (__memmem)
diff --git a/string/memcmp.c b/string/memcmp.c
index 6e93a3128f..dc1a94e6ea 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp)
weak_alias (memcmp, bcmp)
# undef __memcmpeq
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
#endif
diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S
index 37f37b9191..5dc4ee5f0b 100644
--- a/sysdeps/aarch64/memcmp.S
+++ b/sysdeps/aarch64/memcmp.S
@@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp)
#undef __memcmpeq
strong_alias (memcmp, __memcmpeq)
libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S
index 2a4ae577b0..9aacfd4cab 100644
--- a/sysdeps/csky/abiv2/memcmp.S
+++ b/sysdeps/csky/abiv2/memcmp.S
@@ -140,4 +140,5 @@ END (memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
libc_hidden_def (memcmp)
+libc_hidden_def (__memcmpeq)
.weak memcmp
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 90266d904b..cc3329bef4 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp)
#undef __memcmpeq
strong_alias (memcmp, __memcmpeq)
libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/i386/i686/multiarch/memcmp-ia32.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
index a5b5c3d349..74188f74ab 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-ia32.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
@@ -26,6 +26,10 @@
used by IFUNC. */
# define libc_hidden_builtin_def(name) \
.globl __GI_memcmp; __GI_memcmp = memcmp
+
+# undef libc_hidden_def
+# define libc_hidden_def(name) \
+ .globl __GI___memcmpeq; __GI___memcmpeq = __memcmpeq
# endif
# undef weak_alias
diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c
index 3b2815edbc..eb7cb9f2e2 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.c
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
#endif
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 02473c2c0c..f224db4681 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp)
#undef __memcmpeq
strong_alias (memcmp, __memcmpeq)
libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S
index 7722908751..3ab04d4f8a 100644
--- a/sysdeps/ia64/memcmp.S
+++ b/sysdeps/ia64/memcmp.S
@@ -162,3 +162,4 @@ END(memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S
index c2836040a7..339091be0d 100644
--- a/sysdeps/powerpc/powerpc32/405/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/405/memcmp.S
@@ -127,3 +127,4 @@ END (memcmp)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp,bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S
index f58e34aba5..0df97dbf49 100644
--- a/sysdeps/powerpc/powerpc32/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S
index f8deb4e32c..25be9a7f51 100644
--- a/sysdeps/powerpc/powerpc32/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S
@@ -1374,3 +1374,4 @@ END (memcmp)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
index f81c73a29c..b0cd3ddde7 100644
--- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S
@@ -178,3 +178,4 @@ END (MEMCMP)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S
index cc82be115f..3731bb0a73 100644
--- a/sysdeps/powerpc/powerpc64/power4/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S
@@ -1375,3 +1375,4 @@ END (MEMCMP)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S
index 3044f7ede9..29ae19d843 100644
--- a/sysdeps/powerpc/powerpc64/power7/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S
@@ -1060,3 +1060,4 @@ END (MEMCMP)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S
index 0c6a154502..897a5713ce 100644
--- a/sysdeps/powerpc/powerpc64/power8/memcmp.S
+++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S
@@ -1443,3 +1443,4 @@ END (MEMCMP)
libc_hidden_builtin_def (memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S
index d625bf90dd..5808f9365d 100644
--- a/sysdeps/s390/memcmp-z900.S
+++ b/sysdeps/s390/memcmp-z900.S
@@ -165,6 +165,7 @@ END(MEMCMP_Z196)
strong_alias (MEMCMP_DEFAULT, memcmp)
weak_alias (memcmp, bcmp)
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
#endif
#if defined SHARED && IS_IN (libc)
diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c
index 52c20af772..cc58279389 100644
--- a/sysdeps/s390/memcmp.c
+++ b/sysdeps/s390/memcmp.c
@@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp,
)
weak_alias (memcmp, bcmp);
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
#endif
diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S
index fefeee5f5d..d237945554 100644
--- a/sysdeps/sparc/sparc64/memcmp.S
+++ b/sysdeps/sparc/sparc64/memcmp.S
@@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp)
#undef __memcmpeq
strong_alias (memcmp, __memcmpeq)
libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 1b351ee092..8a03e572e8 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -361,3 +361,4 @@ weak_alias (memcmp, bcmp)
#undef __memcmpeq
strong_alias (memcmp, __memcmpeq)
libc_hidden_builtin_def (memcmp)
+libc_hidden_def (__memcmpeq)
diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
index af737c5e6c..7b30b7ca2e 100644
--- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
+++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
@@ -22,6 +22,9 @@
# ifdef SHARED
# undef libc_hidden_builtin_def
# define libc_hidden_builtin_def(name)
+
+# undef libc_hidden_def
+# define libc_hidden_def(ignored)
# endif
# undef weak_alias
diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c
index 4a3aad2c9c..7b3409b1dd 100644
--- a/sysdeps/x86_64/multiarch/memcmp.c
+++ b/sysdeps/x86_64/multiarch/memcmp.c
@@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
weak_alias (memcmp, bcmp)
# undef __memcmpeq
strong_alias (memcmp, __memcmpeq)
+libc_hidden_def (__memcmpeq)
# ifdef SHARED
__hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
--
2.25.1
next prev parent reply other threads:[~2021-10-22 21:24 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 20:38 [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-09-27 20:43 ` Joseph Myers
2021-09-27 21:06 ` Noah Goldstein
2021-09-27 21:06 ` [PATCH v2] " Noah Goldstein
2021-09-27 21:52 ` Joseph Myers
2021-09-28 1:24 ` Noah Goldstein
2021-09-28 1:24 ` [PATCH v3] " Noah Goldstein
2021-09-28 8:15 ` Andreas Schwab
2021-09-28 16:47 ` Noah Goldstein
2021-09-28 8:40 ` Florian Weimer
2021-09-28 16:47 ` Noah Goldstein
2021-09-28 16:51 ` Florian Weimer
2021-09-28 16:46 ` [PATCH v4] " Noah Goldstein
2021-09-28 16:50 ` [PATCH v5] " Noah Goldstein
2021-09-28 16:53 ` [PATCH v6] " Noah Goldstein
2021-09-29 8:36 ` Florian Weimer
2021-09-29 15:17 ` Noah Goldstein
2021-09-29 8:52 ` Andreas Schwab
2021-09-29 9:18 ` Florian Weimer
2021-09-29 9:31 ` Andreas Schwab
2021-09-29 9:44 ` Florian Weimer
2021-09-28 16:57 ` [PATCH v1] " Noah Goldstein
2021-09-29 15:17 ` [PATCH v7] " Noah Goldstein
2021-09-30 19:31 ` Noah Goldstein
2021-10-11 2:33 ` Noah Goldstein
2021-10-18 14:47 ` Noah Goldstein
2021-10-21 19:28 ` H.J. Lu
2021-10-21 19:58 ` Noah Goldstein
2021-10-21 20:00 ` H.J. Lu
2021-10-21 21:04 ` Noah Goldstein
2021-10-21 20:02 ` Adhemerval Zanella
2021-10-21 20:23 ` Noah Goldstein
2021-10-21 20:26 ` Adhemerval Zanella
2021-10-21 19:33 ` Adhemerval Zanella
2021-10-21 20:01 ` Noah Goldstein
2021-10-21 20:06 ` Adhemerval Zanella
2021-10-21 21:18 ` Florian Weimer
2021-10-21 20:07 ` H.J. Lu
2021-10-21 20:11 ` Noah Goldstein
2021-10-21 22:38 ` [PATCH v8 1/3] " Noah Goldstein
2021-10-21 22:38 ` [PATCH v8 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-21 22:52 ` H.J. Lu
2021-10-21 23:08 ` Joseph Myers
2021-10-21 23:10 ` H.J. Lu
2021-10-21 23:14 ` Joseph Myers
2021-10-21 23:39 ` Noah Goldstein
2021-10-21 23:45 ` Noah Goldstein
2021-10-22 0:19 ` Joseph Myers
2021-10-22 0:40 ` H.J. Lu
2021-10-25 16:41 ` Joseph Myers
2021-10-22 0:18 ` Joseph Myers
2021-10-21 22:38 ` [PATCH v8 3/3] String: Add tests for __memcmpeq Noah Goldstein
2021-10-21 22:57 ` H.J. Lu
2021-10-21 23:47 ` Noah Goldstein
2021-10-22 0:41 ` H.J. Lu
2021-10-22 1:01 ` Noah Goldstein
2021-10-21 22:50 ` [PATCH v8 1/3] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-21 23:42 ` Noah Goldstein
2021-10-22 2:38 ` H.J. Lu
2021-10-22 4:04 ` Noah Goldstein
2021-10-22 5:49 ` [PATCH v9 " Noah Goldstein
2021-10-22 12:38 ` H.J. Lu
2021-10-22 16:07 ` Noah Goldstein
2021-10-22 17:19 ` Noah Goldstein
2021-10-22 17:40 ` Noah Goldstein
2021-10-22 17:44 ` H.J. Lu
2021-10-22 18:09 ` Noah Goldstein
2021-10-22 18:33 ` H.J. Lu
2021-10-22 5:49 ` [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 12:44 ` H.J. Lu
2021-10-22 5:49 ` [PATCH v9 3/3] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 12:42 ` H.J. Lu
2021-10-22 16:06 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-22 16:06 ` [PATCH v10 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 16:06 ` [PATCH v10 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 16:06 ` [PATCH v10 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 16:12 ` H.J. Lu
2021-10-22 16:12 ` [PATCH v10 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-22 16:18 ` Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 " Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 18:37 ` [PATCH v11 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 19:46 ` [PATCH v12 4/4] NEWS: Add item " Noah Goldstein
2021-10-22 20:28 ` [PATCH v12 1/4] String: Add support for __memcmpeq() ABI on all targets H.J. Lu
2021-10-22 20:33 ` Noah Goldstein
2021-10-22 20:45 ` H.J. Lu
2021-10-22 21:24 ` Noah Goldstein
2021-10-22 21:23 ` [PATCH v13 " Noah Goldstein
2021-10-22 21:23 ` Noah Goldstein [this message]
2021-10-22 21:23 ` [PATCH v13 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-22 21:23 ` [PATCH v13 4/4] NEWS: Add item " Noah Goldstein
2021-10-23 23:23 ` [PATCH v13 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-23 23:24 ` [PATCH v14 " Noah Goldstein
2021-10-23 23:24 ` [PATCH v14 2/4] String: Add hidden defs for __memcmpeq() to enable internal usage Noah Goldstein
2021-10-26 18:56 ` H.J. Lu
2021-10-23 23:24 ` [PATCH v14 3/4] String: Add tests for __memcmpeq Noah Goldstein
2021-10-26 18:57 ` H.J. Lu
2021-10-23 23:24 ` [PATCH v14 4/4] NEWS: Add item " Noah Goldstein
2021-10-26 18:58 ` H.J. Lu
2021-10-25 2:45 ` [PATCH v14 1/4] String: Add support for __memcmpeq() ABI on all targets Noah Goldstein
2021-10-26 18:55 ` H.J. Lu
2021-10-26 22:29 ` Noah Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211022212358.2164568-2-goldstein.w.n@gmail.com \
--to=goldstein.w.n@gmail.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).