1 This is a workaround for broken code which issues memcpy requests with
2 overlapping arguments. With this patch installed, if the file
3 /etc/sysconfig/32bit_ssse3_memcpy_via_32bit_ssse3_memmove exists then a
4 32bit memcpy call which normally would be handled by the SSSE3 memcpy
5 implementation would instead be handled by the 32bit SSSE3 memmove
6 implementation which is more tolerant of overlaps.
8 diff -Nrup a/sysdeps/i386/i686/multiarch/memcpy.S b/sysdeps/i386/i686/multiarch/memcpy.S
9 --- a/sysdeps/i386/i686/multiarch/memcpy.S 2010-05-04 05:27:23.000000000 -0600
10 +++ b/sysdeps/i386/i686/multiarch/memcpy.S 2012-11-20 14:19:52.890780415 -0700
13 #include <init-arch.h>
17 + .ascii "/etc/sysconfig/32bit_ssse3_memcpy_via_32bit_ssse3_memmove"
19 /* Define multiple versions only for the definition in lib and for
20 DSO. In static binaries we need memcpy before the initialization
22 @@ -48,6 +52,26 @@ ENTRY(memcpy)
23 1: leal __memcpy_ia32@GOTOFF(%ebx), %eax
24 testl $bit_SSSE3, CPUID_OFFSET+index_SSSE3+__cpu_features@GOTOFF(%ebx)
27 + /* This is an inlined access (magicfile, 0) syscall.
29 + Note that it clobbers %ebx, so we have to save/restore
30 + it around the syscall. */
32 + leal L(magicfile)@GOTOFF(%ebx), %ebx
38 + /* If the file did not exist, then %eax will be -1..-4095 and we
39 + do nothing special. */
43 + leal __memmove_ssse3@GOTOFF(%ebx), %eax
46 leal __memcpy_ssse3@GOTOFF(%ebx), %eax
47 testl $bit_Fast_Rep_String, FEATURE_OFFSET+index_Fast_Rep_String+__cpu_features@GOTOFF(%ebx)