SHA256
1
0
forked from pool/glibc
glibc/glibc-disable-backward-memcpy.diff

46 lines
1.8 KiB
Diff
Raw Normal View History

Index: glibc-2.13/sysdeps/x86_64/multiarch/Makefile
===================================================================
--- glibc-2.13.orig/sysdeps/x86_64/multiarch/Makefile
+++ glibc-2.13/sysdeps/x86_64/multiarch/Makefile
@@ -6,7 +6,7 @@ endif
ifeq ($(subdir),string)
sysdep_routines += stpncpy-c strncpy-c strcmp-ssse3 strncmp-ssse3 \
strend-sse4 memcmp-sse4 memcpy-ssse3 mempcpy-ssse3 \
- memmove-ssse3 memcpy-ssse3-back mempcpy-ssse3-back \
+ memmove-ssse3 mempcpy-ssse3-back \
memmove-ssse3-back strcasestr-nonascii strcasecmp_l-ssse3 \
strncase_l-ssse3 strlen-sse4 strlen-no-bsf \
memset-x86-64
Index: glibc-2.13/sysdeps/x86_64/multiarch/memcpy.S
===================================================================
--- glibc-2.13.orig/sysdeps/x86_64/multiarch/memcpy.S
+++ glibc-2.13/sysdeps/x86_64/multiarch/memcpy.S
@@ -35,9 +35,11 @@ ENTRY(memcpy)
testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
jz 2f
leaq __memcpy_ssse3(%rip), %rax
+ /* disable backward memcpy for glibc 2.13
testl $bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip)
jz 2f
leaq __memcpy_ssse3_back(%rip), %rax
+ */
2: ret
END(memcpy)
Index: glibc-2.13/sysdeps/x86_64/multiarch/memcpy_chk.S
===================================================================
--- glibc-2.13.orig/sysdeps/x86_64/multiarch/memcpy_chk.S
+++ glibc-2.13/sysdeps/x86_64/multiarch/memcpy_chk.S
@@ -36,9 +36,11 @@ ENTRY(__memcpy_chk)
testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip)
jz 2f
leaq __memcpy_chk_ssse3(%rip), %rax
+ /* disable backwards memcpy until glibc 2.14
testl $bit_Fast_Copy_Backward, __cpu_features+FEATURE_OFFSET+index_Fast_Copy_Backward(%rip)
jz 2f
leaq __memcpy_chk_ssse3_back(%rip), %rax
+ */
2: ret
END(__memcpy_chk)
# else