[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ld-linux.so.2 segmentation fault with new memcpy

From: Johan Evenhuis
Subject: ld-linux.so.2 segmentation fault with new memcpy
Date: Mon, 14 Jul 2003 21:48:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; nl-NL; rv:1.1) Gecko/20020826

Dear glib-maintainer,

After have learned the basics of assembler, I decided to practice a little by writing a memcpy function, because I new the original one (glibc-2.3.2/sysdeps/i386/i686glibc-2.3.2/sysdeps/i386/i686/memcpy.S) had a performance problem on my system (PIII). It was caused by lack of making memory addresses dividable by 8, which is needed by the used "cld; rep movsl" combination to perform fast. Another problem of this combination was that it used quite some time to start, so it shouldn't be used to copy just a few bytes.

While rebuilding libc with a rewritten memcpy, execution of ld-linux.so.2 (which uses memcpy) failed with a segmentation fault. So I tried to narrow this problem and found the next code sample, inserted in the original memcpy code, causes it:

   jmp 2f
   movl 1f, %eax
1:    .long 3

It seems that moving a labeled address or the value it points to is forbidden in ld-linux.so.2, even if this instruction is only present but not executed. Do you know how to do what seems to be forbidden here?

Best regards,

J. Evenhuis

Attachment: glibc.remake.log.bz2
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]