]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
S390: Fix FAIL in test string/tst-xbzero-opt [BZ #21006]
authorStefan Liebler <stli@linux.vnet.ibm.com>
Tue, 17 Jan 2017 07:54:58 +0000 (08:54 +0100)
committerStefan Liebler <stli@linux.vnet.ibm.com>
Tue, 17 Jan 2017 07:54:58 +0000 (08:54 +0100)
On s390x this test failed with:
FAIL: explicit clear/test: expected 0 got 1

In setup_explicit_clear, the buffer is filled with the test_pattern.
On s390x the memcpy in prepare_test_buffer is done by loading
r4 / r5 with the test_pattern and using store multiple instruction
to store r4 / r5 to buf.
If explicit_bzero is resolved in setup_explicit_clear, r4 / r5 is
stored to stack by _dl_runtime_resolve and the call to memmem in
count_test_patterns finds a hit of the test_pattern on the stack.

This patch resolves all symbols at program startup by linking with
-z now.  This omits the call of _dl_runtime_resolve within
setup_explicit_clear and the test passes.

ChangeLog:

[BZ #21006]
* string/Makefile (LDFLAGS-tst-xbzero-opt): New variable.

ChangeLog
string/Makefile

index 66ce72be9b58cbcbfb35a48b5021b0e2868ae13a..424f8b9108d16b58f291fbe7976da408a711eb3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-17  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       [BZ #21006]
+       * string/Makefile (LDFLAGS-tst-xbzero-opt): New variable.
+
 2017-01-16  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #21045]
index 7b3afa01ae6ff4d8c6d9c65f6a78dba6d0b23583..901c4d4d77f8caa4aafb70c062f8e804cb312850 100644 (file)
@@ -74,6 +74,14 @@ CFLAGS-stratcliff.c = -fno-builtin
 CFLAGS-test-ffs.c = -fno-builtin
 CFLAGS-tst-inlcall.c = -fno-builtin
 CFLAGS-tst-xbzero-opt.c = -O3
+# BZ 21006: Resolve all functions but at least explicit_bzero at startup.
+# Otherwise the test fails on s390x as the memcpy in prepare_test_buffer is
+# done by loading r4 / r5 with the test_pattern and using store multiple
+# instruction to store r4 / r5 to buf.  If explicit_bzero would be resolved in
+# setup_explicit_clear, r4 / r5 would be stored to stack by _dl_runtime_resolve
+# and the call to memmem in count_test_patterns will find a hit of the
+# test_pattern on the stack.
+LDFLAGS-tst-xbzero-opt = -z now
 
 # Called during TLS initialization.
 CFLAGS-memcpy.c = $(no-stack-protector)