diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2013-05-23 23:37:00 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2013-05-23 23:37:00 +0200 |
commit | f9e888643115b4b2f28853ebd1733f4410fb8839 (patch) | |
tree | 58c69f6cef623679080e8933b6c79880bfbd7cb8 /sysdeps/i386/strchr.S | |
parent | d78eef6ebc008f784f501ce208bef12c6eafda27 (diff) | |
parent | b934acf0e93c5a220551ed6e686bb9d45a24a8cc (diff) |
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'sysdeps/i386/strchr.S')
-rw-r--r-- | sysdeps/i386/strchr.S | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/sysdeps/i386/strchr.S b/sysdeps/i386/strchr.S index b0ba99b42b..666c7498fe 100644 --- a/sysdeps/i386/strchr.S +++ b/sysdeps/i386/strchr.S @@ -21,24 +21,20 @@ #include <sysdep.h> #include "asm-syntax.h" -#include "bp-sym.h" -#include "bp-asm.h" -#define PARMS LINKAGE+4 /* space for 1 saved reg */ +#define PARMS 4+4 /* space for 1 saved reg */ #define RTN PARMS -#define STR RTN+RTN_SIZE -#define CHR STR+PTR_SIZE +#define STR RTN +#define CHR STR+4 .text -ENTRY (BP_SYM (strchr)) - ENTER +ENTRY (strchr) pushl %edi /* Save callee-safe registers used here. */ cfi_adjust_cfa_offset (4) cfi_rel_offset (edi, 0) movl STR(%esp), %eax movl CHR(%esp), %edx - CHECK_BOUNDS_LOW (%eax, STR(%esp)) /* At the moment %edx contains C. What we need for the algorithm is C in all bytes of the dword. Avoid @@ -243,13 +239,11 @@ L(11): movl (%eax), %ecx /* get word (= 4 bytes) in question */ L(2): /* Return NULL. */ xorl %eax, %eax - RETURN_NULL_BOUNDED_POINTER popl %edi /* restore saved register content */ cfi_adjust_cfa_offset (-4) cfi_restore (edi) - LEAVE - RET_PTR + ret cfi_adjust_cfa_offset (4) cfi_rel_offset (edi, 0) @@ -285,15 +279,12 @@ L(7): testb %cl, %cl /* is first byte C? */ incl %eax L(6): - CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb) - RETURN_BOUNDED_POINTER (STR(%esp)) popl %edi /* restore saved register content */ cfi_adjust_cfa_offset (-4) cfi_restore (edi) - LEAVE - RET_PTR -END (BP_SYM (strchr)) + ret +END (strchr) -weak_alias (BP_SYM (strchr), BP_SYM (index)) +weak_alias (strchr, index) libc_hidden_builtin_def (strchr) |