patches/glibc/2.3.3/glibc-2.3.2-arm-fix-strlen.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 See also
     2 http://lists.gnu.org/archive/html/bug-glibc/2002-12/msg00056.html
     3 http://lists.arm.linux.org.uk/pipermail/linux-arm-toolchain/2004-June/000016.html
     4 
     5 2002-12-12  Andreas Schwab  <schwab@suse.de>
     6         * sysdeps/arm/strlen.S: Fix last word check for big endian.
     7 
     8 To: libc-alpha at sources dot redhat dot com
     9 Subject: [PATCH] REPOST: ARM big-endian strlen() fix
    10 References: <m3brjy27mo.fsf@defiant.pm.waw.pl>
    11 From: Krzysztof Halasa <khc at pm dot waw dot pl>
    12 Date: Thu, 10 Jun 2004 13:41:44 +0200
    13 Message-ID: <m3r7sn8wsn.fsf@defiant.pm.waw.pl>
    14 MIME-Version: 1.0
    15 Content-Type: multipart/mixed; boundary="=-=-="
    16 
    17 --=-=-=
    18 
    19 The attached patch fixes strlen() on big-endian ARM. Please apply.
    20 Thanks.
    21 -- 
    22 Krzysztof Halasa, B*FH
    23 
    24 --=-=-=
    25 Content-Type: text/x-patch
    26 Content-Disposition: inline; filename=glibc-strlen.patch
    27 
    28 --- glibc-2.3.3.old/sysdeps/arm/strlen.S	2003-04-30 00:47:20.000000000 +0200
    29 +++ glibc-2.3.3/sysdeps/arm/strlen.S	2004-06-06 03:21:48.351931240 +0200
    30 @@ -53,12 +53,21 @@
    31  	ldrne   r2, [r1], $4            @ and we continue to the next word
    32  	bne     Laligned                @
    33  Llastword:				@ drop through to here once we find a
    34 +#ifdef __ARMEB__
    35 +	tst     r2, $0xff000000         @ word that has a zero byte in it
    36 +	addne   r0, r0, $1              @
    37 +	tstne   r2, $0x00ff0000         @ and add up to 3 bytes on to it
    38 +	addne   r0, r0, $1              @
    39 +	tstne   r2, $0x0000ff00         @ (if first three all non-zero, 4th
    40 +	addne   r0, r0, $1              @  must be zero)
    41 +#else
    42  	tst     r2, $0x000000ff         @ word that has a zero byte in it
    43  	addne   r0, r0, $1              @
    44  	tstne   r2, $0x0000ff00         @ and add up to 3 bytes on to it
    45  	addne   r0, r0, $1              @
    46  	tstne   r2, $0x00ff0000         @ (if first three all non-zero, 4th
    47  	addne   r0, r0, $1              @  must be zero)
    48 +#endif
    49  	RETINSTR(mov,pc,lr)
    50  END(strlen)
    51  libc_hidden_builtin_def (strlen)
    52 
    53 --=-=-=--
    54