patches/glibc/2.3.2/glibc-2.3.2-arm-fix-strlen.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.2/glibc-2.3.2-arm-fix-strlen.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,54 @@
     1.4 +See also
     1.5 +http://lists.gnu.org/archive/html/bug-glibc/2002-12/msg00056.html
     1.6 +http://lists.arm.linux.org.uk/pipermail/linux-arm-toolchain/2004-June/000016.html
     1.7 +
     1.8 +2002-12-12  Andreas Schwab  <schwab@suse.de>
     1.9 +        * sysdeps/arm/strlen.S: Fix last word check for big endian.
    1.10 +
    1.11 +To: libc-alpha at sources dot redhat dot com
    1.12 +Subject: [PATCH] REPOST: ARM big-endian strlen() fix
    1.13 +References: <m3brjy27mo.fsf@defiant.pm.waw.pl>
    1.14 +From: Krzysztof Halasa <khc at pm dot waw dot pl>
    1.15 +Date: Thu, 10 Jun 2004 13:41:44 +0200
    1.16 +Message-ID: <m3r7sn8wsn.fsf@defiant.pm.waw.pl>
    1.17 +MIME-Version: 1.0
    1.18 +Content-Type: multipart/mixed; boundary="=-=-="
    1.19 +
    1.20 +--=-=-=
    1.21 +
    1.22 +The attached patch fixes strlen() on big-endian ARM. Please apply.
    1.23 +Thanks.
    1.24 +-- 
    1.25 +Krzysztof Halasa, B*FH
    1.26 +
    1.27 +--=-=-=
    1.28 +Content-Type: text/x-patch
    1.29 +Content-Disposition: inline; filename=glibc-strlen.patch
    1.30 +
    1.31 +--- glibc-2.3.3.old/sysdeps/arm/strlen.S	2003-04-30 00:47:20.000000000 +0200
    1.32 ++++ glibc-2.3.3/sysdeps/arm/strlen.S	2004-06-06 03:21:48.351931240 +0200
    1.33 +@@ -53,12 +53,21 @@
    1.34 + 	ldrne   r2, [r1], $4            @ and we continue to the next word
    1.35 + 	bne     Laligned                @
    1.36 + Llastword:				@ drop through to here once we find a
    1.37 ++#ifdef __ARMEB__
    1.38 ++	tst     r2, $0xff000000         @ word that has a zero byte in it
    1.39 ++	addne   r0, r0, $1              @
    1.40 ++	tstne   r2, $0x00ff0000         @ and add up to 3 bytes on to it
    1.41 ++	addne   r0, r0, $1              @
    1.42 ++	tstne   r2, $0x0000ff00         @ (if first three all non-zero, 4th
    1.43 ++	addne   r0, r0, $1              @  must be zero)
    1.44 ++#else
    1.45 + 	tst     r2, $0x000000ff         @ word that has a zero byte in it
    1.46 + 	addne   r0, r0, $1              @
    1.47 + 	tstne   r2, $0x0000ff00         @ and add up to 3 bytes on to it
    1.48 + 	addne   r0, r0, $1              @
    1.49 + 	tstne   r2, $0x00ff0000         @ (if first three all non-zero, 4th
    1.50 + 	addne   r0, r0, $1              @  must be zero)
    1.51 ++#endif
    1.52 + 	RETINSTR(mov,pc,lr)
    1.53 + END(strlen)
    1.54 + libc_hidden_builtin_def (strlen)
    1.55 +
    1.56 +--=-=-=--
    1.57 +