From: H.J. Lu Date: Wed, 26 Aug 2015 14:59:15 +0000 (-0700) Subject: Replace MEMPCPY_P/PIC with USE_AS_MEMPCPY/SHARED X-Git-Tag: glibc-2.23~555 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b6e19c4bdcb6b7093a3913ce26f6ec50b9a6e0dc;p=thirdparty%2Fglibc.git Replace MEMPCPY_P/PIC with USE_AS_MEMPCPY/SHARED Replace MEMPCPY_P with USE_AS_MEMPCPY in i586 memcpy.S to support i386 multi-arch memcpy. Also we should check SHARED not PIC for libc.so since libc.a may be compiled with PIC. * sysdeps/i386/i586/memcpy.S (MEMPCPY_P): Removed. Check USE_AS_MEMPCPY/SHARED instead of MEMPCPY_P/PIC. * sysdeps/i386/i586/mempcpy.S (USE_AS_MEMPCPY): New. --- diff --git a/ChangeLog b/ChangeLog index 478a0096579..a7ff93e3d76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-08-26 H.J. Lu + + * sysdeps/i386/i586/memcpy.S (MEMPCPY_P): Removed. + Check USE_AS_MEMPCPY/SHARED instead of MEMPCPY_P/PIC. + * sysdeps/i386/i586/mempcpy.S (USE_AS_MEMPCPY): New. + 2015-08-26 H.J. Lu * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os, diff --git a/sysdeps/i386/i586/memcpy.S b/sysdeps/i386/i586/memcpy.S index 97973658b64..e0ac6928f1d 100644 --- a/sysdeps/i386/i586/memcpy.S +++ b/sysdeps/i386/i586/memcpy.S @@ -20,11 +20,6 @@ #include #include "asm-syntax.h" -/* BEWARE: `#ifdef memcpy' means that memcpy is redefined as `mempcpy', - and the return value is the byte after the last one copied in - the destination. */ -#define MEMPCPY_P (defined memcpy) - #define PARMS 4+8 /* space for 2 saved regs */ #define RTN PARMS #define DEST RTN @@ -105,13 +100,13 @@ L(3): movl 28(%edi), %edx /* Correct extra loop counter modification. */ L(2): addl $32, %ecx -#if !MEMPCPY_P +#ifndef USE_AS_MEMPCPY movl DEST(%esp), %eax #endif L(1): rep; movsb -#if MEMPCPY_P +#ifdef USE_AS_MEMPCPY movl %edi, %eax #endif @@ -124,6 +119,6 @@ L(1): rep; movsb ret END (memcpy) -#if !MEMPCPY_P +#ifndef USE_AS_MEMPCPY libc_hidden_builtin_def (memcpy) #endif diff --git a/sysdeps/i386/i586/mempcpy.S b/sysdeps/i386/i586/mempcpy.S index afc112d9d79..720a4c09234 100644 --- a/sysdeps/i386/i586/mempcpy.S +++ b/sysdeps/i386/i586/mempcpy.S @@ -1,3 +1,4 @@ +#define USE_AS_MEMPCPY #define memcpy __mempcpy #define __memcpy_chk __mempcpy_chk #include