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.
This commit is contained in:
David S. Miller 2010-02-20 13:42:07 -08:00
parent 5c866a8b9b
commit 2daff75bab
2 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,9 @@
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_runtime_setup): * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_runtime_setup):
Adjust rela->r_offset by l->l_addr when rewriting PLT. 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> 2009-02-20 Joseph Myers <joseph@codesourcery.com>
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_runtime_setup): * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_runtime_setup):

View File

@ -96,7 +96,7 @@ ENTRY(__memchr)
* %o4 = value XOR c */ * %o4 = value XOR c */
2: cmp %o0, %o2 /* IEU1 Group */ 2: cmp %o0, %o2 /* IEU1 Group */
bg,pn %XCC, 11f /* CTI */ bgu,pn %XCC, 11f /* CTI */
ldxa [%o0] ASI_PNF, %o3 /* Load */ ldxa [%o0] ASI_PNF, %o3 /* Load */
sub %o4, %g1, %o5 /* IEU0 Group */ sub %o4, %g1, %o5 /* IEU0 Group */
add %o0, 8, %o0 /* IEU1 */ add %o0, 8, %o0 /* IEU1 */