[PATCH] powerpc string.h memset, memcpy, memmove brocken

Joakim Tjernlund joakim.tjernlund at transmode.se
Fri Mar 28 17:20:51 UTC 2008


On Thu, 2008-03-20 at 12:18 +0100, Erik Sallmann wrote:
> Hello,
> 
> the ppc memset, memcpy, memmove from string.h didn't work for me.
> Busybox-Vi always got a segfault. I only debugged the memset.c.
> Memmove and memcpy were replaced by simpler functions.
> The failure is in the "align" section. In the case that only n==1
> characters had to be replaced and for an aligned adress there are
> remaining rem==3 spaces with n=n-rem; an overflow occurred.

Had a closer look and I can't see your problem. n is >= 8 in the
align part due to this check:
chunks = n / 8;
...
if (!chunks)
	goto lessthan8;

So how do you end up with n == 1 in align? You might want to check
gcc isn't miscompiling memset and friends.

  Jocke



More information about the uClibc mailing list