about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-02-20 13:42:07 -0800
committerDavid S. Miller <davem@davemloft.net>2010-02-20 13:48:06 -0800
commit2daff75bab89a597b2a29bc6f3c7f88e12352355 (patch)
treea7fad24afe394a6b5f25dbd066b72a073df4fa55
parent5c866a8b9be0bd8dff97dd8143e55dd228617c23 (diff)
downloadglibc-2daff75bab89a597b2a29bc6f3c7f88e12352355.tar.gz
glibc-2daff75bab89a597b2a29bc6f3c7f88e12352355.tar.xz
glibc-2daff75bab89a597b2a29bc6f3c7f88e12352355.zip
sparc: Fix v9 memchr with long buffer lengths.
test-memchr fails on 32-bit sparc with v9 optimized memchr because
it uses signed branch comparisons on the buffer pointers.
-rw-r--r--ChangeLog3
-rw-r--r--sysdeps/sparc/sparc64/memchr.S2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cd1be57595..8b91c5f9ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
 	* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_runtime_setup):
 	Adjust rela->r_offset by l->l_addr when rewriting PLT.
 
+	* sysdeps/sparc/sparc64/memchr.S: Use unsigned branch on greater to
+	test end of buffer.
+
 2009-02-20  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_runtime_setup):
diff --git a/sysdeps/sparc/sparc64/memchr.S b/sysdeps/sparc/sparc64/memchr.S
index 4f13cb5706..ab1666bfb5 100644
--- a/sysdeps/sparc/sparc64/memchr.S
+++ b/sysdeps/sparc/sparc64/memchr.S
@@ -96,7 +96,7 @@ ENTRY(__memchr)
 							 * %o4 =   value XOR c		*/
 2:	cmp		%o0, %o2			/* IEU1		Group		*/
 
-	bg,pn		%XCC, 11f			/* CTI				*/
+	bgu,pn		%XCC, 11f			/* CTI				*/
 	 ldxa		[%o0] ASI_PNF, %o3		/* Load				*/
 	sub		%o4, %g1, %o5			/* IEU0		Group		*/
 	add		%o0, 8, %o0			/* IEU1				*/