patches/glibc/2.3.6/160-sh-memset.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jan 06 22:22:02 2009 +0000 (2009-01-06)
changeset 1130 78681fe5cdd1
parent 402 197e1b49586e
permissions -rw-r--r--
Update all samples to the latest set of config options.
There might be some small issues here and there due to the split of CT_ExtractAndPatch.

/trunk/samples/x86_64-unknown-linux-gnu/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/sh4-unknown-linux-gnu/crosstool.config | 13 10 3 0 +++++++++---
/trunk/samples/armeb-unknown-linux-uclibc/crosstool.config | 10 7 3 0 ++++++---
/trunk/samples/arm-unknown-elf/crosstool.config | 8 4 4 0 +++---
/trunk/samples/arm-unknown-linux-gnueabi/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/armeb-unknown-eabi/crosstool.config | 8 4 4 0 +++---
/trunk/samples/ia64-unknown-linux-gnu/crosstool.config | 13 10 3 0 +++++++++---
/trunk/samples/x86_64-unknown-linux-uclibc/crosstool.config | 11 8 3 0 +++++++---
/trunk/samples/armeb-unknown-linux-gnueabi/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/powerpc-e500v2-linux-gnuspe/crosstool.config | 11 8 3 0 +++++++---
/trunk/samples/i686-nptl-linux-gnu/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/powerpc-unknown-linux-gnu/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/arm-unknown-linux-gnu/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/mips-unknown-linux-uclibc/crosstool.config | 10 7 3 0 ++++++---
/trunk/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 11 8 3 0 +++++++---
/trunk/samples/arm-iphone-linux-gnueabi/crosstool.config | 5 2 3 0 ++---
/trunk/samples/armeb-unknown-linux-gnu/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/powerpc-unknown_nofpu-linux-gnu/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/powerpc-unknown-linux-uclibc/crosstool.config | 10 7 3 0 ++++++---
/trunk/samples/arm-unknown-linux-uclibc/crosstool.config | 11 8 3 0 +++++++---
/trunk/samples/i586-geode-linux-uclibc/crosstool.config | 11 8 3 0 +++++++---
/trunk/samples/powerpc-405-linux-gnu/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/mips-unknown-elf/crosstool.config | 8 4 4 0 +++---
/trunk/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 11 8 3 0 +++++++---
/trunk/samples/mipsel-unknown-linux-gnu/crosstool.config | 13 10 3 0 +++++++++---
/trunk/samples/arm-unknown-eabi/crosstool.config | 8 4 4 0 +++---
/trunk/samples/alphaev56-unknown-linux-gnu/crosstool.config | 14 11 3 0 ++++++++++---
/trunk/samples/powerpc-860-linux-gnu/crosstool.config | 13 10 3 0 +++++++++---
28 files changed, 237 insertions(+), 88 deletions(-)
yann@402
     1
From:
yann@402
     2
	http://sources.redhat.com/ml/libc-alpha/2005-07/msg00051.html
yann@402
     3
	http://sources.redhat.com/ml/crossgcc/2005-10/msg00035.html
yann@402
     4
yann@402
     5
Message-ID: <434576E1.6020305@sscd.de>
yann@402
     6
Date: Thu, 06 Oct 2005 21:11:29 +0200
yann@402
     7
From: Alexander Sieb <sieb at sscd dot de>
yann@402
     8
To: crossgcc at sourceware dot org
yann@402
     9
Subject: Crosstool sh4-linux-gcc-4.0.2-glibc-2.3.5 patches
yann@402
    10
yann@402
    11
On sh[34]-linux, memset function does not work if 2nd argument is negative
yann@402
    12
and 3rd argument is greater than 12.
yann@402
    13
for example, memset(ptr, "\xda", 20) sets 0xff instead of 0xda.
yann@402
    14
 
yann@402
    15
Attached patch fixes this problem.
yann@402
    16
 
yann@402
    17
	* sysdeps/sh/memset.S (memset): Correct 2nd argument handling.
yann@402
    18
 
yann@402
    19
--- glibc-2.3.5.old/sysdeps/sh/memset.S	29 Apr 2003 22:47:18 -0000	1.4
yann@402
    20
+++ glibc-2.3.5/sysdeps/sh/memset.S	23 Jul 2005 08:37:21 -0000
yann@402
    21
@@ -28,6 +28,7 @@ ENTRY(memset)
yann@402
    22
 	bt.s	L_byte_loop_init
yann@402
    23
 	mov	r4,r7
yann@402
    24
 
yann@402
    25
+	extu.b	r5,r5
yann@402
    26
 	swap.b	r5,r1
yann@402
    27
 	or	r1,r5
yann@402
    28
	swap.w	r5,r1
yann@402
    29
yann@402
    30
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>