summaryrefslogtreecommitdiff
path: root/libc/sysdeps/i386/i686
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/i386/i686')
-rw-r--r--libc/sysdeps/i386/i686/Makefile2
-rw-r--r--libc/sysdeps/i386/i686/add_n.S23
-rw-r--r--libc/sysdeps/i386/i686/bzero.S2
-rw-r--r--libc/sysdeps/i386/i686/memcmp.S20
-rw-r--r--libc/sysdeps/i386/i686/memcpy.S19
-rw-r--r--libc/sysdeps/i386/i686/memmove.S31
-rw-r--r--libc/sysdeps/i386/i686/mempcpy.S25
-rw-r--r--libc/sysdeps/i386/i686/memset.S20
-rw-r--r--libc/sysdeps/i386/i686/strcmp.S27
-rw-r--r--libc/sysdeps/i386/i686/strtok.S60
-rw-r--r--libc/sysdeps/i386/i686/strtok_r.S4
11 files changed, 68 insertions, 165 deletions
diff --git a/libc/sysdeps/i386/i686/Makefile b/libc/sysdeps/i386/i686/Makefile
index e6b292458..01c291789 100644
--- a/libc/sysdeps/i386/i686/Makefile
+++ b/libc/sysdeps/i386/i686/Makefile
@@ -15,13 +15,11 @@ CFLAGS-.o += -Wa,-mtune=i686
CFLAGS-.os += -Wa,-mtune=i686
CFLAGS-.op += -Wa,-mtune=i686
CFLAGS-.og += -Wa,-mtune=i686
-CFLAGS-.ob += -Wa,-mtune=i686
CFLAGS-.oS += -Wa,-mtune=i686
ASFLAGS-.o += -Wa,-mtune=i686
ASFLAGS-.os += -Wa,-mtune=i686
ASFLAGS-.op += -Wa,-mtune=i686
ASFLAGS-.og += -Wa,-mtune=i686
-ASFLAGS-.ob += -Wa,-mtune=i686
ASFLAGS-.oS += -Wa,-mtune=i686
endif
diff --git a/libc/sysdeps/i386/i686/add_n.S b/libc/sysdeps/i386/i686/add_n.S
index 5e91aad74..1e2cdc550 100644
--- a/libc/sysdeps/i386/i686/add_n.S
+++ b/libc/sysdeps/i386/i686/add_n.S
@@ -19,22 +19,19 @@
#include "sysdep.h"
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+8 /* space for 2 saved regs */
+#define PARMS 4+8 /* space for 2 saved regs */
#define RES PARMS
-#define S1 RES+PTR_SIZE
-#define S2 S1+PTR_SIZE
-#define SIZE S2+PTR_SIZE
+#define S1 RES+4
+#define S2 S1+4
+#define SIZE S2+4
.text
#ifdef PIC
L(1): addl (%esp), %eax
ret
#endif
-ENTRY (BP_SYM (__mpn_add_n))
- ENTER
+ENTRY (__mpn_add_n)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -47,13 +44,6 @@ ENTRY (BP_SYM (__mpn_add_n))
cfi_rel_offset (esi, 0)
movl S2(%esp),%edx
movl SIZE(%esp),%ecx
-#if __BOUNDED_POINTERS__
- shll $2, %ecx /* convert limbs to bytes */
- CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, S1(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%edx, S2(%esp), %ecx)
- shrl $2, %ecx
-#endif
movl %ecx,%eax
shrl $3,%ecx /* compute count for unrolled loop */
negl %eax
@@ -116,6 +106,5 @@ L(oop): movl (%esi),%eax
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
ret
-END (BP_SYM (__mpn_add_n))
+END (__mpn_add_n)
diff --git a/libc/sysdeps/i386/i686/bzero.S b/libc/sysdeps/i386/i686/bzero.S
index c1e4a6d50..34b0faa91 100644
--- a/libc/sysdeps/i386/i686/bzero.S
+++ b/libc/sysdeps/i386/i686/bzero.S
@@ -1,3 +1,3 @@
#define memset __bzero
#include <sysdeps/i386/i686/memset.S>
-weak_alias (BP_SYM (__bzero), BP_SYM (bzero))
+weak_alias (__bzero, bzero)
diff --git a/libc/sysdeps/i386/i686/memcmp.S b/libc/sysdeps/i386/i686/memcmp.S
index eacac8ee1..b8091a60e 100644
--- a/libc/sysdeps/i386/i686/memcmp.S
+++ b/libc/sysdeps/i386/i686/memcmp.S
@@ -18,17 +18,15 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* Preserve EBX. */
+#define PARMS 4+4 /* Preserve EBX. */
#define BLK1 PARMS
-#define BLK2 BLK1+PTR_SIZE
-#define LEN BLK2+PTR_SIZE
+#define BLK2 BLK1+4
+#define LEN BLK2+4
#define ENTRANCE pushl %ebx; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (ebx, 0); ENTER
+ cfi_rel_offset (ebx, 0)
#define RETURN popl %ebx; cfi_adjust_cfa_offset (-4); \
- cfi_restore (ebx); LEAVE; ret
+ cfi_restore (ebx); ret
/* Load an entry in a jump table into EBX. TABLE is a jump table
with relative offsets. INDEX is a register contains the index
@@ -44,7 +42,7 @@
.text
ALIGN (4)
-ENTRY (BP_SYM (memcmp))
+ENTRY (memcmp)
ENTRANCE
movl BLK1(%esp), %eax
@@ -366,7 +364,7 @@ L(set):
cfi_adjust_cfa_offset (-4)
cfi_restore (esi)
RETURN
-END (BP_SYM (memcmp))
+END (memcmp)
.section .rodata
ALIGN (2)
@@ -406,5 +404,5 @@ L(table_32bytes) :
#undef bcmp
-weak_alias (BP_SYM (memcmp), BP_SYM (bcmp))
-libc_hidden_builtin_def (BP_SYM (memcmp))
+weak_alias (memcmp, bcmp)
+libc_hidden_builtin_def (memcmp)
diff --git a/libc/sysdeps/i386/i686/memcpy.S b/libc/sysdeps/i386/i686/memcpy.S
index e6dc87d77..bb05c3d0b 100644
--- a/libc/sysdeps/i386/i686/memcpy.S
+++ b/libc/sysdeps/i386/i686/memcpy.S
@@ -20,14 +20,12 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
-#define LEN SRC+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
+#define LEN SRC+4
.text
#if defined PIC && !defined NOT_IN_libc
@@ -37,8 +35,7 @@ ENTRY_CHK (__memcpy_chk)
jb HIDDEN_JUMPTARGET (__chk_fail)
END_CHK (__memcpy_chk)
#endif
-ENTRY (BP_SYM (memcpy))
- ENTER
+ENTRY (memcpy)
movl %edi, %eax
movl DEST(%esp), %edi
@@ -81,10 +78,8 @@ ENTRY (BP_SYM (memcpy))
.Lend: movl %eax, %edi
movl %edx, %esi
movl DEST(%esp), %eax
- RETURN_BOUNDED_POINTER (DEST(%esp))
- LEAVE
- RET_PTR
+ ret
/* When we come here the pointers do not have the same
alignment or the length is too short. No need to optimize for
@@ -99,5 +94,5 @@ ENTRY (BP_SYM (memcpy))
2: rep
movsl
jmp .Lend
-END (BP_SYM (memcpy))
+END (memcpy)
libc_hidden_builtin_def (memcpy)
diff --git a/libc/sysdeps/i386/i686/memmove.S b/libc/sysdeps/i386/i686/memmove.S
index 607985147..8c53d4a9a 100644
--- a/libc/sysdeps/i386/i686/memmove.S
+++ b/libc/sysdeps/i386/i686/memmove.S
@@ -20,22 +20,20 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE+4 /* one spilled register */
+#define PARMS 4+4 /* one spilled register */
#define RTN PARMS
.text
#ifdef USE_AS_BCOPY
-# define SRC RTN+RTN_SIZE
-# define DEST SRC+PTR_SIZE
-# define LEN DEST+PTR_SIZE
+# define SRC RTN
+# define DEST SRC+4
+# define LEN DEST+4
#else
-# define DEST RTN+RTN_SIZE
-# define SRC DEST+PTR_SIZE
-# define LEN SRC+PTR_SIZE
+# define DEST RTN
+# define SRC DEST+4
+# define LEN SRC+4
# if defined PIC && !defined NOT_IN_libc
ENTRY_CHK (__memmove_chk)
@@ -46,8 +44,7 @@ END_CHK (__memmove_chk)
# endif
#endif
-ENTRY (BP_SYM (memmove))
- ENTER
+ENTRY (memmove)
pushl %edi
cfi_adjust_cfa_offset (4)
@@ -58,8 +55,6 @@ ENTRY (BP_SYM (memmove))
movl %esi, %edx
movl SRC(%esp), %esi
cfi_register (esi, edx)
- CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx)
- CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx)
movl %edi, %eax
subl %esi, %eax
@@ -79,15 +74,13 @@ ENTRY (BP_SYM (memmove))
cfi_restore (esi)
#ifndef USE_AS_BCOPY
movl DEST(%esp), %eax
- RETURN_BOUNDED_POINTER (DEST(%esp))
#endif
popl %edi
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
+ ret
cfi_adjust_cfa_offset (4)
cfi_rel_offset (edi, 0)
@@ -113,7 +106,6 @@ ENTRY (BP_SYM (memmove))
cfi_restore (esi)
#ifndef USE_AS_BCOPY
movl DEST(%esp), %eax
- RETURN_BOUNDED_POINTER (DEST(%esp))
#endif
cld
@@ -121,9 +113,8 @@ ENTRY (BP_SYM (memmove))
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
- RET_PTR
-END (BP_SYM (memmove))
+ ret
+END (memmove)
#ifndef USE_AS_BCOPY
libc_hidden_builtin_def (memmove)
#endif
diff --git a/libc/sysdeps/i386/i686/mempcpy.S b/libc/sysdeps/i386/i686/mempcpy.S
index 8022b7b95..97fd4966a 100644
--- a/libc/sysdeps/i386/i686/mempcpy.S
+++ b/libc/sysdeps/i386/i686/mempcpy.S
@@ -20,14 +20,12 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define RTN PARMS
-#define DEST RTN+RTN_SIZE
-#define SRC DEST+PTR_SIZE
-#define LEN SRC+PTR_SIZE
+#define DEST RTN
+#define SRC DEST+4
+#define LEN SRC+4
.text
#if defined PIC && !defined NOT_IN_libc
@@ -37,18 +35,15 @@ ENTRY_CHK (__mempcpy_chk)
jb HIDDEN_JUMPTARGET (__chk_fail)
END_CHK (__mempcpy_chk)
#endif
-ENTRY (BP_SYM (__mempcpy))
- ENTER
+ENTRY (__mempcpy)
movl LEN(%esp), %ecx
movl %edi, %eax
cfi_register (edi, eax)
movl DEST(%esp), %edi
- CHECK_BOUNDS_BOTH_WIDE (%edi, DEST(%esp), %ecx)
movl %esi, %edx
cfi_register (esi, edx)
movl SRC(%esp), %esi
- CHECK_BOUNDS_BOTH_WIDE (%esi, SRC(%esp), %ecx)
cld
shrl $1, %ecx
jnc 1f
@@ -62,11 +57,9 @@ ENTRY (BP_SYM (__mempcpy))
cfi_restore (edi)
movl %edx, %esi
cfi_restore (esi)
- RETURN_BOUNDED_POINTER (DEST(%esp))
- LEAVE
- RET_PTR
-END (BP_SYM (__mempcpy))
-libc_hidden_def (BP_SYM (__mempcpy))
-weak_alias (BP_SYM (__mempcpy), BP_SYM (mempcpy))
+ ret
+END (__mempcpy)
+libc_hidden_def (__mempcpy)
+weak_alias (__mempcpy, mempcpy)
libc_hidden_builtin_def (mempcpy)
diff --git a/libc/sysdeps/i386/i686/memset.S b/libc/sysdeps/i386/i686/memset.S
index ad0c9677f..aed79a8aa 100644
--- a/libc/sysdeps/i386/i686/memset.S
+++ b/libc/sysdeps/i386/i686/memset.S
@@ -20,20 +20,18 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* BEWARE: `#ifdef memset' means that memset is redefined as `bzero' */
#define BZERO_P (defined memset)
-#define PARMS LINKAGE+4 /* space for 1 saved reg */
+#define PARMS 4+4 /* space for 1 saved reg */
#if BZERO_P
# define DEST PARMS
-# define LEN DEST+PTR_SIZE
+# define LEN DEST+4
#else
# define RTN PARMS
-# define DEST RTN+RTN_SIZE
-# define CHR DEST+PTR_SIZE
+# define DEST RTN
+# define CHR DEST+4
# define LEN CHR+4
#endif
@@ -45,15 +43,13 @@ ENTRY_CHK (__memset_chk)
jb HIDDEN_JUMPTARGET (__chk_fail)
END_CHK (__memset_chk)
#endif
-ENTRY (BP_SYM (memset))
- ENTER
+ENTRY (memset)
cld
pushl %edi
cfi_adjust_cfa_offset (4)
movl DEST(%esp), %edx
movl LEN(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%edx, DEST(%esp), %ecx)
#if BZERO_P
xorl %eax, %eax /* fill with 0 */
#else
@@ -90,19 +86,17 @@ ENTRY (BP_SYM (memset))
1:
#if !BZERO_P
movl DEST(%esp), %eax /* start address of destination is result */
- RETURN_BOUNDED_POINTER (DEST(%esp))
#endif
popl %edi
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
- LEAVE
#if BZERO_P
ret
#else
- RET_PTR
+ ret
#endif
-END (BP_SYM (memset))
+END (memset)
libc_hidden_builtin_def (memset)
#if defined PIC && !defined NOT_IN_libc && !BZERO_P
diff --git a/libc/sysdeps/i386/i686/strcmp.S b/libc/sysdeps/i386/i686/strcmp.S
index b53260ffd..6ca6220a0 100644
--- a/libc/sysdeps/i386/i686/strcmp.S
+++ b/libc/sysdeps/i386/i686/strcmp.S
@@ -19,21 +19,16 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
+#define PARMS 4 /* no space for saved regs */
#define STR1 PARMS
-#define STR2 STR1+PTR_SIZE
+#define STR2 STR1+4
.text
-ENTRY (BP_SYM (strcmp))
- ENTER
+ENTRY (strcmp)
movl STR1(%esp), %ecx
movl STR2(%esp), %edx
- CHECK_BOUNDS_LOW (%ecx, STR1(%esp))
- CHECK_BOUNDS_LOW (%edx, STR2(%esp))
L(oop): movb (%ecx), %al
cmpb (%edx), %al
@@ -46,26 +41,12 @@ L(oop): movb (%ecx), %al
xorl %eax, %eax
/* when strings are equal, pointers rest one beyond
the end of the NUL terminators. */
- CHECK_BOUNDS_HIGH (%ecx, STR1(%esp), jbe)
- CHECK_BOUNDS_HIGH (%edx, STR2(%esp), jbe)
- LEAVE
ret
-#ifndef __BOUNDED_POINTERS__
L(neq): movl $1, %eax
movl $-1, %ecx
cmovbl %ecx, %eax
-#else
-L(neq): movl $1, %eax
- ja L(chk)
- negl %eax
- /* When strings differ, pointers rest on
- the unequal characters. */
-L(chk): CHECK_BOUNDS_HIGH (%ecx, STR1(%esp), jb)
- CHECK_BOUNDS_HIGH (%edx, STR2(%esp), jb)
-#endif
- LEAVE
ret
-END (BP_SYM (strcmp))
+END (strcmp)
libc_hidden_builtin_def (strcmp)
diff --git a/libc/sysdeps/i386/i686/strtok.S b/libc/sysdeps/i386/i686/strtok.S
index 794efbaed..8848faf4d 100644
--- a/libc/sysdeps/i386/i686/strtok.S
+++ b/libc/sysdeps/i386/i686/strtok.S
@@ -20,8 +20,6 @@
#include <sysdep.h>
#include "asm-syntax.h"
-#include "bp-sym.h"
-#include "bp-asm.h"
/* This file can be used for three variants of the strtok function:
@@ -46,11 +44,7 @@
.type save_ptr, @object
.size save_ptr, 4
save_ptr:
-# if __BOUNDED_POINTERS__
- .space 12
-# else
.space 4
-# endif
# ifdef PIC
# define SAVE_PTR save_ptr@GOTOFF(%ebx)
@@ -62,15 +56,15 @@ save_ptr:
#endif
#if !defined USE_AS_STRTOK_R && defined PIC
-# define PARMS LINKAGE+256+4 /* space for table and saved PIC register */
+# define PARMS 4+256+4 /* space for table and saved PIC register */
#else
-# define PARMS LINKAGE+256 /* space for table */
+# define PARMS 4+256 /* space for table */
#endif
#define RTN PARMS
-#define STR RTN+RTN_SIZE
-#define DELIM STR+PTR_SIZE
+#define STR RTN
+#define DELIM STR+4
#ifdef USE_AS_STRTOK_R
-# define SAVE DELIM+PTR_SIZE
+# define SAVE DELIM+4
#endif
.text
@@ -80,8 +74,7 @@ save_ptr:
ret
#endif
-ENTRY (BP_SYM (FUNCTION))
- ENTER
+ENTRY (FUNCTION)
#if !defined USE_AS_STRTOK_R && defined PIC
pushl %ebx /* Save PIC register. */
@@ -127,23 +120,7 @@ ENTRY (BP_SYM (FUNCTION))
cmove %eax, %edx
testl %edx, %edx
jz L(returnNULL)
-#if __BOUNDED_POINTERS__
-# ifdef USE_AS_STRTOK_R
- movl SAVE(%esp), %ecx /* borrow %ecx for a moment */
-# endif
- je L(0)
- /* Save bounds of incoming non-NULL STR into save area. */
- movl 4+STR(%esp), %eax
- movl %eax, 4+SAVE_PTR
- movl 8+STR(%esp), %eax
- movl %eax, 8+SAVE_PTR
-L(0): CHECK_BOUNDS_LOW (%edx, SAVE_PTR)
-# ifdef USE_AS_STRTOK_R
- xorl %ecx, %ecx /* restore %ecx to zero */
-# endif
-#endif
movl DELIM(%esp), %eax /* Get start of delimiter set. */
- CHECK_BOUNDS_LOW (%eax, DELIM(%esp))
/* For understanding the following code remember that %ecx == 0 now.
Although all the following instruction only modify %cl we always
@@ -151,17 +128,17 @@ L(0): CHECK_BOUNDS_LOW (%edx, SAVE_PTR)
L(2): movb (%eax), %cl /* get byte from stopset */
testb %cl, %cl /* is NUL char? */
- jz L(1_1) /* yes => start compare loop */
+ jz L(1) /* yes => start compare loop */
movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
movb 1(%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
- jz L(1_2) /* yes => start compare loop */
+ jz L(1) /* yes => start compare loop */
movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
movb 2(%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
- jz L(1_3) /* yes => start compare loop */
+ jz L(1) /* yes => start compare loop */
movb %cl, (%esp,%ecx) /* set corresponding byte in stopset table */
movb 3(%eax), %cl /* get byte from stopset */
@@ -170,16 +147,7 @@ L(2): movb (%eax), %cl /* get byte from stopset */
testb $0xff, %cl /* is NUL char? */
jnz L(2) /* no => process next dword from stopset */
-#if __BOUNDED_POINTERS__
- jmp L(1_0) /* pointer is correct for bounds check */
-L(1_3): incl %eax /* adjust pointer for bounds check */
-L(1_2): incl %eax /* ditto */
-L(1_1): incl %eax /* ditto */
-L(1_0): CHECK_BOUNDS_HIGH (%eax, DELIM(%esp), jbe)
-#else
-L(1_3):; L(1_2):; L(1_1): /* fall through */
-#endif
- leal -4(%edx), %eax /* prepare loop */
+L(1): leal -4(%edx), %eax /* prepare loop */
/* We use a neat trick for the following loop. Normally we would
have to test for two termination conditions
@@ -253,8 +221,6 @@ L(8): cmpl %eax, %edx
movl SAVE(%esp), %ecx
#endif
movl %edx, SAVE_PTR
- CHECK_BOUNDS_HIGH (%edx, SAVE_PTR, jb)
- RETURN_BOUNDED_POINTER (SAVE_PTR)
L(epilogue):
/* Remove the stopset table. */
@@ -265,8 +231,7 @@ L(epilogue):
cfi_adjust_cfa_offset (-4)
cfi_restore (ebx)
#endif
- LEAVE
- RET_PTR
+ ret
L(returnNULL):
xorl %eax, %eax
@@ -274,7 +239,6 @@ L(returnNULL):
movl SAVE(%esp), %ecx
#endif
movl %edx, SAVE_PTR
- RETURN_NULL_BOUNDED_POINTER
jmp L(epilogue)
-END (BP_SYM (FUNCTION))
+END (FUNCTION)
diff --git a/libc/sysdeps/i386/i686/strtok_r.S b/libc/sysdeps/i386/i686/strtok_r.S
index 1c24ca85f..353e076ba 100644
--- a/libc/sysdeps/i386/i686/strtok_r.S
+++ b/libc/sysdeps/i386/i686/strtok_r.S
@@ -1,5 +1,5 @@
#define FUNCTION __strtok_r
#define USE_AS_STRTOK_R 1
#include <sysdeps/i386/i686/strtok.S>
-weak_alias (BP_SYM (__strtok_r), BP_SYM (strtok_r))
-strong_alias (BP_SYM (__strtok_r), BP_SYM (__GI___strtok_r))
+weak_alias (__strtok_r, strtok_r)
+strong_alias (__strtok_r, __GI___strtok_r)