1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/glibc/2.3.6/160-glibc-2.3.5-sh-memset.patch Sun Jun 15 22:02:45 2008 +0000
1.3 @@ -0,0 +1,30 @@
1.4 +From:
1.5 + http://sources.redhat.com/ml/libc-alpha/2005-07/msg00051.html
1.6 + http://sources.redhat.com/ml/crossgcc/2005-10/msg00035.html
1.7 +
1.8 +Message-ID: <434576E1.6020305@sscd.de>
1.9 +Date: Thu, 06 Oct 2005 21:11:29 +0200
1.10 +From: Alexander Sieb <sieb at sscd dot de>
1.11 +To: crossgcc at sourceware dot org
1.12 +Subject: Crosstool sh4-linux-gcc-4.0.2-glibc-2.3.5 patches
1.13 +
1.14 +On sh[34]-linux, memset function does not work if 2nd argument is negative
1.15 +and 3rd argument is greater than 12.
1.16 +for example, memset(ptr, "\xda", 20) sets 0xff instead of 0xda.
1.17 +
1.18 +Attached patch fixes this problem.
1.19 +
1.20 + * sysdeps/sh/memset.S (memset): Correct 2nd argument handling.
1.21 +
1.22 +--- glibc-2.3.5.old/sysdeps/sh/memset.S 29 Apr 2003 22:47:18 -0000 1.4
1.23 ++++ glibc-2.3.5/sysdeps/sh/memset.S 23 Jul 2005 08:37:21 -0000
1.24 +@@ -28,6 +28,7 @@ ENTRY(memset)
1.25 + bt.s L_byte_loop_init
1.26 + mov r4,r7
1.27 +
1.28 ++ extu.b r5,r5
1.29 + swap.b r5,r1
1.30 + or r1,r5
1.31 + swap.w r5,r1
1.32 +
1.33 +Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>