Question about memmove implemented for uClibc arm

Denys Vlasenko vda.linux at googlemail.com
Thu May 22 12:27:40 UTC 2008


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



More information about the uClibc mailing list