about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/i386/i586/memcpy.S7
-rw-r--r--sysdeps/i386/i586/mempcpy.S1
-rw-r--r--sysdeps/i386/i586/memset.S7
4 files changed, 21 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 29e1293c0f..b27b3e53cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* sysdeps/i386/i586/memcpy.S (__memcpy_chk): New definition.
+	* sysdeps/i386/i586/mempcpy.S (__memcpy_chk): New definition.
+	* sysdeps/i386/i586/memset.S (__memset_chk): New definition.
+
 2007-09-15  Mike Frysinger  <vapier@gentoo.org>
 
 	* inet/inet_net.c: Reset digit to 0 for inputs starting with "0x".
diff --git a/sysdeps/i386/i586/memcpy.S b/sysdeps/i386/i586/memcpy.S
index 6ab457fc55..677a7e6204 100644
--- a/sysdeps/i386/i586/memcpy.S
+++ b/sysdeps/i386/i586/memcpy.S
@@ -35,6 +35,13 @@
 #define LEN	SRC+PTR_SIZE
 
         .text
+#if defined PIC && !defined NOT_IN_libc
+ENTRY (__memcpy_chk)
+	movl	12(%esp), %eax
+	cmpl	%eax, 16(%esp)
+	jb	HIDDEN_JUMPTARGET (__chk_fail)
+END (__memcpy_chk)
+#endif
 ENTRY (BP_SYM (memcpy))
 	ENTER
 
diff --git a/sysdeps/i386/i586/mempcpy.S b/sysdeps/i386/i586/mempcpy.S
index 0c9520e3b4..f492be7ca0 100644
--- a/sysdeps/i386/i586/mempcpy.S
+++ b/sysdeps/i386/i586/mempcpy.S
@@ -1,4 +1,5 @@
 #define memcpy __mempcpy
+#define __memcpy_chk __mempcpy_chk
 #include <sysdeps/i386/i586/memcpy.S>
 
 libc_hidden_def (BP_SYM (__mempcpy))
diff --git a/sysdeps/i386/i586/memset.S b/sysdeps/i386/i586/memset.S
index c21e9f7a71..3295b48e71 100644
--- a/sysdeps/i386/i586/memset.S
+++ b/sysdeps/i386/i586/memset.S
@@ -38,6 +38,13 @@
 #endif
 
         .text
+#if defined PIC && !defined NOT_IN_libc && !BZERO_P
+ENTRY (__memset_chk)
+	movl	12(%esp), %eax
+	cmpl	%eax, 16(%esp)
+	jb	HIDDEN_JUMPTARGET (__chk_fail)
+END (__memset_chk)
+#endif
 ENTRY (BP_SYM (memset))
 	ENTER