]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Replace MEMPCPY_P/PIC with USE_AS_MEMPCPY/SHARED
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 26 Aug 2015 14:59:15 +0000 (07:59 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 26 Aug 2015 14:59:32 +0000 (07:59 -0700)
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.

ChangeLog
sysdeps/i386/i586/memcpy.S
sysdeps/i386/i586/mempcpy.S

index 478a00965799d7f9c611338b7c99cc08d8dc367c..a7ff93e3d76a14ea702941dc41e294931dcbfade 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * 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  <hongjiu.lu@intel.com>
 
        * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os,
index 97973658b64491b7ed69be1716d27b80b578f47e..e0ac6928f1d0d93a909d2be7cc9a5ddef687f3f9 100644 (file)
 #include <sysdep.h>
 #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
index afc112d9d7986697ae1f93b73a4837dc30db2e27..720a4c09234105c3f416481d71ce16e3e5a46f40 100644 (file)
@@ -1,3 +1,4 @@
+#define USE_AS_MEMPCPY
 #define memcpy __mempcpy
 #define __memcpy_chk __mempcpy_chk
 #include <sysdeps/i386/i586/memcpy.S>