public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] powerpc64le/power9: guard power9 strcmp against rtld usage [BZ# 25905]
@ 2020-05-01 20:32 Paul E. Murphy
  2020-05-04 12:26 ` Adhemerval Zanella
  0 siblings, 1 reply; 8+ messages in thread
From: Paul E. Murphy @ 2020-05-01 20:32 UTC (permalink / raw)
  To: libc-alpha

strcmp is used while resolving PLT references.  Vector registers
should not be used during this.  The P9 strcmp makes heavy use of
vector registers, so it should be avoided in rtld.

This prevents quiet vector register corruption when glibc is configured
with --disable-multi-arch and --with-cpu=power9.  This can be seen with
test-float64x-compat_totalordermag during the first call into
totalordermagf64x@GLIBC_2.27.

Add a guard to fallback to the power8 implementation when building
power9 strcmp for libraries other than libc.
---
 sysdeps/powerpc/powerpc64/le/power9/strcmp.S | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sysdeps/powerpc/powerpc64/le/power9/strcmp.S b/sysdeps/powerpc/powerpc64/le/power9/strcmp.S
index 412a13599d..b29ea7c020 100644
--- a/sysdeps/powerpc/powerpc64/le/power9/strcmp.S
+++ b/sysdeps/powerpc/powerpc64/le/power9/strcmp.S
@@ -17,6 +17,11 @@
    <https://www.gnu.org/licenses/>.  */
 #include <sysdep.h>
 
+#if !IS_IN(libc)
+/* Fallback to P8 which does not use vector regs for rtld.  */
+#include <sysdeps/powerpc/powerpc64/power8/strcmp.S>
+#else
+
 #ifndef STRCMP
 # define STRCMP strcmp
 #endif
@@ -262,3 +267,5 @@ L(pagecross_nullfound):
 	b	L(pagecross_retdiff)
 END (STRCMP)
 libc_hidden_builtin_def (strcmp)
+
+#endif
-- 
2.21.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-05 21:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 20:32 [PATCH] powerpc64le/power9: guard power9 strcmp against rtld usage [BZ# 25905] Paul E. Murphy
2020-05-04 12:26 ` Adhemerval Zanella
2020-05-04 15:25   ` [PATCHv2] " Paul E. Murphy
2020-05-04 16:36     ` Adhemerval Zanella
2020-05-04 18:02       ` Paul E Murphy
2020-05-04 18:26         ` Adhemerval Zanella
2020-05-04 21:16           ` Paul E Murphy
2020-05-05 21:01             ` Adhemerval Zanella

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).