[PATCHv2] powerpc64le/power9: guard power9 strcmp against rtld usage [BZ# 25905]

Paul E. Murphy murphyp@linux.vnet.ibm.com
Mon May 4 15:25:03 GMT 2020


Use rtld-strcpy.S file in power9 to redirect to power8 implementation
instead.  This builds the power8 strcpy rtld with --with-cpu=power9 and
--disable-multi-arch.  The existing behavior is unchanged when
multi-arch is enabled.

---8<---
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/rtld-strcmp.S | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S

diff --git a/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S b/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S
new file mode 100644
index 0000000000..afdb492b3d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S
@@ -0,0 +1,2 @@
+/* Fallback to P8 which does not use vector regs for rtld.  */
+#include <sysdeps/powerpc/powerpc64/power8/strcmp.S>
-- 
2.21.1



More information about the Libc-alpha mailing list