about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-01-18 10:52:18 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-02-02 09:49:30 -0300
commitaac57faf5425b472a72132b09f4b3a2aa1f77a63 (patch)
tree769c6400df86e714836b6729345395e75647bf5a
parent0e383d2d4e7c08b36ad3edb30c072a3dc4d26ed8 (diff)
downloadglibc-aac57faf5425b472a72132b09f4b3a2aa1f77a63.tar.gz
glibc-aac57faf5425b472a72132b09f4b3a2aa1f77a63.tar.xz
glibc-aac57faf5425b472a72132b09f4b3a2aa1f77a63.zip
sparc: Fix sparc64 memmove length comparison (BZ 31266)
The small counts copy bytes comparsion should be unsigned (as the
memmove size argument).  It fixes string/tst-memmove-overflow on
sparcv9, where the input size triggers an invalid code path.

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

(cherry picked from commit 926a4bdbb5fc8955570208b5571b2d04c6ffbd1d)
-rw-r--r--sysdeps/sparc/sparc64/memmove.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/sparc/sparc64/memmove.S b/sysdeps/sparc/sparc64/memmove.S
index db6f4f0e84..62b19ebc1b 100644
--- a/sysdeps/sparc/sparc64/memmove.S
+++ b/sysdeps/sparc/sparc64/memmove.S
@@ -38,7 +38,7 @@ ENTRY(memmove)
 /*
  * normal, copy forwards
  */
-2:	ble	%XCC, .Ldbytecp
+2:	bleu	%XCC, .Ldbytecp
 	 andcc	%o1, 3, %o5	/* is src word aligned  */
 	bz,pn	%icc, .Laldst
 	 cmp	%o5, 2		/* is src half-word aligned  */