Question about memmove implemented for uClibc arm
Denys Vlasenko
vda.linux at googlemail.com
Thu May 22 16:53:22 UTC 2008
On Thursday 22 May 2008 17:55, 夏Timothy wrote:
> Yes, I agree.
> The code checks whether src address equals to dest address. If so, it returns directly with return value 0.
> However, if src equals to dest, remove_iacs of busybox 1.10.2 would return ptr0. And only if src does not
> equal to dest, remove_ias of busybox 1.10.2 would return with the return value from memmove.
>
> Hence, I believe that this bug would not affect the telnetd of busybox 1.10.2. Thanks a lot for your help.
> And thanks for the help from Khem Raj as well.
I'm sorry, but you didn't answer my question.
If you will do this small test and confirm that it works,
I can fix the bug in svn.
(The question is below in quoted text)
> Best Regards,
> Timothy
> ----------------------------------------
> > From: vda.linux at googlemail.com
> > To: uclibc at uclibc.org
> > Subject: Re: Question about memmove implemented for uClibc arm
> > Date: Thu, 22 May 2008 14:27:40 +0200
> > CC: xwllwx at hotmail.com
> >
> > On Thursday 22 May 2008 10:43, 夏Timothy wrote:
> >> Hi,
> >> Thanks for the help. I have disassembled the code. However.if I post them here,
> >> the mail would be very very long.
> >>
> >> Actually, I think the assembly code for memmove and memcopy could be found in
> >> uClibc/libc/string/arm/memmove.S and uClibc/libc/string/arm/_memcpy.S respectively.
> >
> > I believe bug is here:
> >
> > _memcpy:
> > /* Determine copy direction */
> > cmp r1, r0
> > bcc .Lmemcpy_backwards
> >
> > IT(tt, eq)
> > moveq r0, #0 /* Quick abort for len=0 */
> > #if defined(__USE_BX__)
> > bxeq lr
> > #else
> > moveq pc, lr
> > #endif
> >
> > Does removing just one instruction "moveq r0, #0" help?
> > If not, you probably need to replace it with "moveq r0, r1"
> > --
> > vda
>
> _________________________________________________________________
> 新年换新颜,快来妆扮自己的MSN给心仪的TA一个惊喜!
> http://im.live.cn/emoticons/?ID=18
>
More information about the uClibc
mailing list