From 5a0b6138d8325d6aabd504bcccd7ee5fba07bb25 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 2 Aug 2016 17:46:58 -0700 Subject: [PATCH] Fix wide-char testsuite SIGBUS on platforms such as Sparc. * string/test-strncmp.c (do_test_limit): Make sure the test data stream is aligned as required for the type "CHAR". (do_test): Likewise. --- ChangeLog | 6 ++++++ string/test-strncmp.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0b294c8..8caa301 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-08-02 David S. Miller + + * string/test-strncmp.c (do_test_limit): Make sure the test data + stream is aligned as required for the type "CHAR". + (do_test): Likewise. + 2016-08-03 Aurelien Jarno * sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Replace beqlr instructions diff --git a/string/test-strncmp.c b/string/test-strncmp.c index 8c0a331..d392248 100644 --- a/string/test-strncmp.c +++ b/string/test-strncmp.c @@ -156,6 +156,9 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, size_t i, align_n; CHAR *s1, *s2; + align1 &= ~(CHARBYTES - 1); + align2 &= ~(CHARBYTES - 1); + if (n == 0) { s1 = (CHAR *) (buf1 + page_size); @@ -204,6 +207,9 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char, size_t i; CHAR *s1, *s2; + align1 &= ~(CHARBYTES - 1); + align2 &= ~(CHARBYTES - 1); + if (n == 0) return; -- 2.7.4