This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[patch] SH: memset fix
- From: SUGIOKA Toshinobu <sugioka at itonet dot co dot jp>
- To: libc-alpha at sources dot redhat dot com
- Cc: kkojima at rr dot iij4u dot or dot jp, linuxsh-dev at lists dot sourceforge dot net
- Date: Sat, 23 Jul 2005 21:41:47 +0900
- Subject: [patch] SH: memset fix
Hi,
On sh[34]-linux, memset function does not work if 2nd argument is negative
and 3rd argument is greater than 12.
for example, memset(ptr, '\xda', 20) sets 0xff instead of 0xda.
Attached patch fixes this problem.
* sysdeps/sh/memset.S (memset): Correct 2nd argument handling.
diff -u -p -r1.4 memset.S
--- sysdeps/sh/memset.S 29 Apr 2003 22:47:18 -0000 1.4
+++ sysdeps/sh/memset.S 23 Jul 2005 08:37:21 -0000
@@ -28,6 +28,7 @@ ENTRY(memset)
bt.s L_byte_loop_init
mov r4,r7
+ extu.b r5,r5
swap.b r5,r1
or r1,r5
swap.w r5,r1
Regards,
SUGIOKA Toshinobu