2011-03-24 H.J. Lu PR libc/12518 * string/Versions: Add memcpy to GLIBC_2.13. * sysdeps/x86_64/multiarch/memcpy.S: Include . (memcpy): Renamed to ... (__new_memcpy): This. (memcpy): Provide GLIBC_2_13 memcpy. * sysdeps/x86_64/multiarch/memmove.c: Include . (memcpy): Provide GLIBC_2_2_5 memcpy. diff --git a/string/Versions b/string/Versions index f145fd3..b7bf235 100644 --- a/string/Versions +++ b/string/Versions @@ -80,4 +80,7 @@ libc { GLIBC_2.6 { strerror_l; } + GLIBC_2.13 { + memcpy; + } } diff --git a/sysdeps/x86_64/multiarch/memcpy.S b/sysdeps/x86_64/multiarch/memcpy.S index 8e9fb19..d83059a 100644 --- a/sysdeps/x86_64/multiarch/memcpy.S +++ b/sysdeps/x86_64/multiarch/memcpy.S @@ -19,6 +19,7 @@ 02111-1307 USA. */ #include +#include #include /* Define multiple versions only for the definition in lib and for @@ -26,8 +27,8 @@ happened. */ #if defined SHARED && !defined NOT_IN_libc .text -ENTRY(memcpy) - .type memcpy, @gnu_indirect_function +ENTRY(__new_memcpy) + .type __new_memcpy, @gnu_indirect_function cmpl $0, KIND_OFFSET+__cpu_features(%rip) jne 1f call __init_cpu_features @@ -39,7 +40,7 @@ ENTRY(memcpy) jz 2f leaq __memcpy_ssse3_back(%rip), %rax 2: ret -END(memcpy) +END(__new_memcpy) # undef ENTRY # define ENTRY(name) \ @@ -68,6 +69,8 @@ END(memcpy) by the indirect call in the PLT. */ # define libc_hidden_builtin_def(name) \ .globl __GI_memcpy; __GI_memcpy = __memcpy_sse2 + +versioned_symbol (libc, __new_memcpy, memcpy, GLIBC_2_13); #endif #include "../memcpy.S" diff --git a/sysdeps/x86_64/multiarch/memmove.c b/sysdeps/x86_64/multiarch/memmove.c index 3798627..04692ab 100644 --- a/sysdeps/x86_64/multiarch/memmove.c +++ b/sysdeps/x86_64/multiarch/memmove.c @@ -20,6 +20,7 @@ #include #ifndef NOT_IN_libc +#include #include "init-arch.h" #define MEMMOVE __memmove_sse2 @@ -42,4 +43,8 @@ libc_ifunc (memmove, ? (HAS_FAST_COPY_BACKWARD ? __memmove_ssse3_back : __memmove_ssse3) : __memmove_sse2); + +#if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_13) +compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5); +#endif #endif