aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-04-29 22:49:58 +0000
committerUlrich Drepper <drepper@redhat.com>2003-04-29 22:49:58 +0000
commit85dd10031084e8b4a17d84a08afdb9d24beaa510 (patch)
tree37ada279d9e6dd7b36497913c518b275838ba3a9 /sysdeps/i386
parente40468fa25851309afbc469735897fae83eb893d (diff)
downloadglibc-85dd10031084e8b4a17d84a08afdb9d24beaa510.zip
glibc-85dd10031084e8b4a17d84a08afdb9d24beaa510.tar.gz
glibc-85dd10031084e8b4a17d84a08afdb9d24beaa510.tar.bz2
Update.
* sysdeps/i386/fpu/ftestexcept.c: Also check SSE status word. * include/signal.h: Use libc_hidden_proto for sigaddset and sigdelset. * signal/sigaddset.c: Add libc_hidden_def. * signal/sigdelset.c: Likewise. 2003-04-29 Jakub Jelinek <jakub@redhat.com> * sysdeps/i386/i486/string-inlines.c (__memcpy_g, __strchr_g): Move to the end of the file. * configure.in: Change __oline__ to $LINENO. (HAVE_BUILTIN_REDIRECTION): New check. * config.h.in (HAVE_BUILTIN_REDIRECTION): Add. * include/libc-symbols.h (libc_hidden_builtin_proto, libc_hidden_builtin_def, libc_hidden_builtin_weak, libc_hidden_builtin_ver): Define. * include/string.h (memchr, memcpy, memmove, memset, strcat, strchr, strcmp, strcpy, strcspn, strlen, strncmp, strncpy, strpbrk, strrchr, strspn, strstr): Add libc_hidden_builtin_proto. * intl/plural.y: Include string.h. * sysdeps/alpha/alphaev6/memchr.S (memchr): Add libc_hidden_builtin_def. * sysdeps/alpha/alphaev6/memcpy.S (memcpy): Likewise. * sysdeps/alpha/alphaev6/memset.S (memset): Likewise. * sysdeps/alpha/alphaev67/strcat.S (strcat): Likewise. * sysdeps/alpha/alphaev67/strchr.S (strchr): Likewise. * sysdeps/alpha/alphaev67/strlen.S (strlen): Likewise. * sysdeps/alpha/alphaev67/strrchr.S (strrchr): Likewise. * sysdeps/alpha/memchr.S (memchr): Likewise. * sysdeps/alpha/memset.S (memset): Likewise. * sysdeps/alpha/strcat.S (strcat): Likewise. * sysdeps/alpha/strchr.S (strchr): Likewise. * sysdeps/alpha/strcmp.S (strcmp): Likewise. * sysdeps/alpha/strcpy.S (strcpy): Likewise. * sysdeps/alpha/strlen.S (strlen): Likewise. * sysdeps/alpha/strncmp.S (strncmp): Likewise. * sysdeps/alpha/strncpy.S (strncpy): Likewise. * sysdeps/alpha/strrchr.S (strrchr): Likewise. * sysdeps/arm/memset.S (memset): Likewise. * sysdeps/arm/strlen.S (strlen): Likewise. * sysdeps/generic/memchr.c (memchr): Likewise. * sysdeps/generic/memcpy.c (memcpy): Likewise. * sysdeps/generic/memmove.c (memmove): Likewise. * sysdeps/generic/memset.c (memset): Likewise. * sysdeps/generic/strcat.c (strcat): Likewise. * sysdeps/generic/strchr.c (strchr): Likewise. * sysdeps/generic/strcmp.c (strcmp): Likewise. * sysdeps/generic/strcpy.c (strcpy): Likewise. * sysdeps/generic/strcspn.c (strcspn): Likewise. * sysdeps/generic/strlen.c (strlen): Likewise. * sysdeps/generic/strncmp.c (strncmp): Likewise. * sysdeps/generic/strncpy.c (strncpy): Likewise. * sysdeps/generic/strpbrk.c (strpbrk): Likewise. * sysdeps/generic/strrchr.c (strrchr): Likewise. * sysdeps/generic/strspn.c (strspn): Likewise. * sysdeps/generic/strstr.c (strstr): Likewise. * sysdeps/i386/i486/strcat.S (strcat): Likewise. * sysdeps/i386/i486/strlen.S (strlen): Likewise. * sysdeps/i386/i586/memcpy.S (memcpy): Likewise. * sysdeps/i386/i586/memset.S (memset): Likewise. * sysdeps/i386/i586/strchr.S (strchr): Likewise. * sysdeps/i386/i586/strcpy.S (strcpy): Likewise. * sysdeps/i386/i586/strlen.S (strlen): Likewise. * sysdeps/i386/i686/memcpy.S (memcpy): Likewise. * sysdeps/i386/i686/memmove.S (memmove): Likewise. * sysdeps/i386/i686/memset.S (memset): Likewise. * sysdeps/i386/i686/strcmp.S (strcmp): Likewise. * sysdeps/i386/memchr.S (memchr): Likewise. * sysdeps/i386/memset.c (memset): Likewise. * sysdeps/i386/strchr.S (strchr): Likewise. * sysdeps/i386/strcspn.S (strcspn): Likewise. * sysdeps/i386/strlen.c (strlen): Likewise. * sysdeps/i386/strpbrk.S (strpbrk): Likewise. * sysdeps/i386/strrchr.S (strrchr): Likewise. * sysdeps/i386/strspn.S (strspn): Likewise. * sysdeps/ia64/memchr.S (memchr): Likewise. * sysdeps/ia64/memcpy.S (memcpy): Likewise. * sysdeps/ia64/memmove.S (memmove): Likewise. * sysdeps/ia64/memset.S (memset): Likewise. * sysdeps/ia64/strcat.S (strcat): Likewise. * sysdeps/ia64/strchr.S (strchr): Likewise. * sysdeps/ia64/strcmp.S (strcmp): Likewise. * sysdeps/ia64/strcpy.S (strcpy): Likewise. * sysdeps/ia64/strlen.S (strlen): Likewise. * sysdeps/ia64/strncmp.S (strncmp): Likewise. * sysdeps/ia64/strncpy.S (strncpy): Likewise. * sysdeps/m68k/memchr.S (memchr): Likewise. * sysdeps/m68k/strchr.S (strchr): Likewise. * sysdeps/mips/mips64/memcpy.S (memcpy): Likewise. * sysdeps/mips/mips64/memset.S (memset): Likewise. * sysdeps/mips/memcpy.S (memcpy): Likewise. * sysdeps/mips/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc32/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc32/strchr.S (strchr): Likewise. * sysdeps/powerpc/powerpc32/strcmp.S (strcmp): Likewise. * sysdeps/powerpc/powerpc32/strcpy.S (strcpy): Likewise. * sysdeps/powerpc/powerpc32/strlen.S (strlen): Likewise. * sysdeps/powerpc/powerpc64/memcpy.S (memcpy): Likewise. * sysdeps/powerpc/powerpc64/memset.S (memset): Likewise. * sysdeps/powerpc/powerpc64/strchr.S (strchr): Likewise. * sysdeps/powerpc/powerpc64/strcmp.S (strcmp): Likewise. * sysdeps/powerpc/powerpc64/strcpy.S (strcpy): Likewise. * sysdeps/powerpc/powerpc64/strlen.S (strlen): Likewise. * sysdeps/powerpc/strcat.c (strcat): Likewise. * sysdeps/sparc/sparc32/memchr.S (memchr): Likewise. * sysdeps/sparc/sparc32/memcpy.S (memcpy): Likewise. * sysdeps/sparc/sparc32/memset.S (memset): Likewise. * sysdeps/sparc/sparc32/strcat.S (strcat): Likewise. * sysdeps/sparc/sparc32/strchr.S (strchr, strrchr): Likewise. * sysdeps/sparc/sparc32/strcmp.S (strcmp): Likewise. * sysdeps/sparc/sparc32/strcpy.S (strcpy): Likewise. * sysdeps/sparc/sparc32/strlen.S (strlen): Likewise. * sysdeps/sparc/sparc64/sparcv9b/memcpy.S (memcpy, memmove): Likewise. * sysdeps/sparc/sparc64/memchr.S (memchr): Likewise. * sysdeps/sparc/sparc64/memcpy.S (memcpy, memmove): Likewise. * sysdeps/sparc/sparc64/memset.S (memset): Likewise. * sysdeps/sparc/sparc64/strcat.S (strcat): Likewise. * sysdeps/sparc/sparc64/strchr.S (strchr, strrchr): Likewise. * sysdeps/sparc/sparc64/strcmp.S (strcmp): Likewise. * sysdeps/sparc/sparc64/strcpy.S (strcpy): Likewise. * sysdeps/sparc/sparc64/strcspn.S (strcspn): Likewise. * sysdeps/sparc/sparc64/strlen.S (strlen): Likewise. * sysdeps/sparc/sparc64/strncmp.S (strncmp): Likewise. * sysdeps/sparc/sparc64/strncpy.S (strncpy): Likewise. * sysdeps/sparc/sparc64/strpbrk.S (strpbrk): Likewise. * sysdeps/sparc/sparc64/strspn.S (strspn): Likewise. * sysdeps/sh/memcpy.S (memcpy): Likewise. * sysdeps/sh/memset.S (memset): Likewise. * sysdeps/sh/strlen.S (strlen): Likewise. * sysdeps/s390/s390-32/memchr.S (memchr): Likewise. * sysdeps/s390/s390-32/memcpy.S (memcpy): Likewise. * sysdeps/s390/s390-32/memset.S (memset): Likewise. * sysdeps/s390/s390-32/strcmp.S (strcmp): Likewise. * sysdeps/s390/s390-32/strcpy.S (strcpy): Likewise. * sysdeps/s390/s390-32/strncpy.S (strncpy): Likewise. * sysdeps/s390/s390-64/memchr.S (memchr): Likewise. * sysdeps/s390/s390-64/memcpy.S (memcpy): Likewise. * sysdeps/s390/s390-64/memset.S (memset): Likewise. * sysdeps/s390/s390-64/strcmp.S (strcmp): Likewise. * sysdeps/s390/s390-64/strcpy.S (strcpy): Likewise. * sysdeps/s390/s390-64/strncpy.S (strncpy): Likewise. * sysdeps/x86_64/memcpy.S (memcpy): Likewise. * sysdeps/x86_64/memset.S (memset): Likewise. * sysdeps/x86_64/strcat.S (strcat): Likewise. * sysdeps/x86_64/strchr.S (strchr): Likewise. * sysdeps/x86_64/strcmp.S (strcmp): Likewise. * sysdeps/x86_64/strcpy.S (strcpy): Likewise. * sysdeps/x86_64/strcspn.S (strcspn): Likewise. * sysdeps/x86_64/strlen.S (strlen): Likewise. * sysdeps/x86_64/strspn.S (strspn): Likewise. * string/string-inlines.c: Move... * sysdeps/generic/string-inlines.c: ...here. (__memcpy_g, __strchr_g): Remove. (__NO_INLINE__): Define before including <string.h>, undefine after. Include bits/string.h and bits/string2.h. * sysdeps/i386/i486/string-inlines.c: New file. * sysdeps/i386/string-inlines.c: New file. * sysdeps/i386/i486/Versions: Remove. All GLIBC_2.1.1 symbols moved... * sysdeps/i386/Versions (libc): ...here. 2003-04-29 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/Versions11
-rw-r--r--sysdeps/i386/fpu/fesetround.c4
-rw-r--r--sysdeps/i386/fpu/ftestexcept.c12
-rw-r--r--sysdeps/i386/i486/strcat.S3
-rw-r--r--sysdeps/i386/i486/string-inlines.c65
-rw-r--r--sysdeps/i386/i486/strlen.S3
-rw-r--r--sysdeps/i386/i586/memcpy.S3
-rw-r--r--sysdeps/i386/i586/memset.S3
-rw-r--r--sysdeps/i386/i586/strchr.S3
-rw-r--r--sysdeps/i386/i586/strcpy.S5
-rw-r--r--sysdeps/i386/i586/strlen.S3
-rw-r--r--sysdeps/i386/i686/memcpy.S3
-rw-r--r--sysdeps/i386/i686/memmove.S1
-rw-r--r--sysdeps/i386/i686/memset.S3
-rw-r--r--sysdeps/i386/i686/strcmp.S3
-rw-r--r--sysdeps/i386/memchr.S3
-rw-r--r--sysdeps/i386/memset.c3
-rw-r--r--sysdeps/i386/strchr.S3
-rw-r--r--sysdeps/i386/strcspn.S3
-rw-r--r--sysdeps/i386/string-inlines.c189
-rw-r--r--sysdeps/i386/strlen.c3
-rw-r--r--sysdeps/i386/strpbrk.S3
-rw-r--r--sysdeps/i386/strrchr.S3
-rw-r--r--sysdeps/i386/strspn.S3
24 files changed, 314 insertions, 24 deletions
diff --git a/sysdeps/i386/Versions b/sysdeps/i386/Versions
index 57951eb..b20d7cc 100644
--- a/sysdeps/i386/Versions
+++ b/sysdeps/i386/Versions
@@ -9,7 +9,14 @@ libc {
}
GLIBC_2.1.1 {
# extern inline functions used by <bits/string.h>
- __memcpy_c; __memset_cc; __memset_cg; __memset_gg; __strchr_c; __strchr_g;
- __strchrnul_c; __strchrnul_g;
+ __memcpy_c; __memset_cc; __memset_cg; __memset_gg;
+ __memcpy_by2; __memcpy_by4; __memcpy_g; __mempcpy_by2; __mempcpy_by4;
+ __mempcpy_byn; __memset_ccn_by2; __memset_ccn_by4; __memset_gcn_by2;
+ __memset_gcn_by4; __stpcpy_g; __strcat_c; __strcat_g; __strchr_c;
+ __strchr_g; __strchrnul_c; __strchrnul_g; __strcmp_gg; __strcpy_g;
+ __strcspn_c1; __strcspn_cg; __strcspn_g; __strlen_g; __strncat_g;
+ __strncmp_g; __strncpy_by2; __strncpy_by4; __strncpy_byn; __strncpy_gg;
+ __strpbrk_cg; __strpbrk_g; __strrchr_c; __strrchr_g; __strspn_c1;
+ __strspn_cg; __strspn_g; __strstr_cg; __strstr_g;
}
}
diff --git a/sysdeps/i386/fpu/fesetround.c b/sysdeps/i386/fpu/fesetround.c
index 342ed42..fae74d3 100644
--- a/sysdeps/i386/fpu/fesetround.c
+++ b/sysdeps/i386/fpu/fesetround.c
@@ -43,8 +43,8 @@ fesetround (int round)
unsigned int xcw;
__asm__ ("stmxcsr %0" : "=m" (*&xcw));
- cw &= ~0x6000;
- cw |= round << 3;
+ xcw &= ~0x6000;
+ xcw |= round << 3;
__asm__ ("ldmxcsr %0" : : "m" (*&xcw));
}
diff --git a/sysdeps/i386/fpu/ftestexcept.c b/sysdeps/i386/fpu/ftestexcept.c
index cee7b83..e449571 100644
--- a/sysdeps/i386/fpu/ftestexcept.c
+++ b/sysdeps/i386/fpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -19,14 +19,22 @@
02111-1307 USA. */
#include <fenv.h>
+#include <unistd.h>
+#include <dl-procinfo.h>
+#include <ldsodefs.h>
int
fetestexcept (int excepts)
{
int temp;
+ int xtemp = 0;
/* Get current exceptions. */
__asm__ ("fnstsw %0" : "=a" (temp));
- return temp & excepts & FE_ALL_EXCEPT;
+ /* If the CPU supports SSE we test the MXCSR as well. */
+ if ((GL(dl_hwcap_mask) & HWCAP_I386_XMM) != 0)
+ __asm__ ("stmxcsr %0" : "=m" (*&xtemp));
+
+ return (temp | xtemp) & excepts & FE_ALL_EXCEPT;
}
diff --git a/sysdeps/i386/i486/strcat.S b/sysdeps/i386/i486/strcat.S
index a206e40..7d8279f 100644
--- a/sysdeps/i386/i486/strcat.S
+++ b/sysdeps/i386/i486/strcat.S
@@ -1,6 +1,6 @@
/* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
- Copyright (C) 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994,1995,1996,1997,2000,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
@@ -267,3 +267,4 @@ L(8): /* GKM FIXME: check high bounds */
LEAVE
RET_PTR
END (BP_SYM (strcat))
+libc_hidden_builtin_def (strcat)
diff --git a/sysdeps/i386/i486/string-inlines.c b/sysdeps/i386/i486/string-inlines.c
new file mode 100644
index 0000000..7136d2c
--- /dev/null
+++ b/sysdeps/i386/i486/string-inlines.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* <bits/string.h> and <bits/string2.h> declare some extern inline
+ functions. These functions are declared additionally here if
+ inlining is not possible. */
+
+#undef __USE_STRING_INLINES
+#define __USE_STRING_INLINES
+#define _FORCE_INLINES
+#define __STRING_INLINE /* empty */
+#define __NO_INLINE__
+
+/* This is to avoid PLT entries for the x86 version. */
+#define __memcpy_g __memcpy_g_internal
+#define __strchr_g __strchr_g_internal
+
+#include <string.h>
+#undef index
+#undef rindex
+
+#undef __NO_INLINE__
+#include <bits/string.h>
+#include <bits/string2.h>
+
+void *
+(__memcpy_c) (void *d, const void *s, size_t n)
+{
+ return memcpy (d, s, n);
+}
+
+void *
+__memset_cc (void *s, unsigned long int pattern, size_t n)
+{
+ return memset (s, pattern & 0xff, n);
+}
+strong_alias (__memset_cc, __memset_cg)
+
+void *
+__memset_gg (void *s, char c, size_t n)
+{
+ return memset (s, c, n);
+}
+
+#ifdef __memcpy_c
+# undef __memcpy_g
+strong_alias (__memcpy_g_internal, __memcpy_g)
+# undef __strchr_g
+strong_alias (__strchr_g_internal, __strchr_g)
+#endif
diff --git a/sysdeps/i386/i486/strlen.S b/sysdeps/i386/i486/strlen.S
index eed0c76..7557b2d 100644
--- a/sysdeps/i386/i486/strlen.S
+++ b/sysdeps/i386/i486/strlen.S
@@ -1,6 +1,6 @@
/* strlen(str) -- determine the length of the string STR.
Optimized for Intel 80x86, x>=4.
- Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1991-1997, 2000, 2003 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>.
This file is part of the GNU C Library.
@@ -136,3 +136,4 @@ L(2): CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
LEAVE
ret
END (BP_SYM (strlen))
+libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/i386/i586/memcpy.S b/sysdeps/i386/i586/memcpy.S
index 0501d59..766d479 100644
--- a/sysdeps/i386/i586/memcpy.S
+++ b/sysdeps/i386/i586/memcpy.S
@@ -1,5 +1,5 @@
/* Highly optimized version for i586.
- Copyright (C) 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -116,3 +116,4 @@ L(1): rep; movsb
LEAVE
RET_PTR
END (BP_SYM (memcpy))
+libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/i386/i586/memset.S b/sysdeps/i386/i586/memset.S
index 1ff854f..0b59849 100644
--- a/sysdeps/i386/i586/memset.S
+++ b/sysdeps/i386/i586/memset.S
@@ -1,6 +1,6 @@
/* memset/bzero -- set memory area to CH/0
Highly optimized version for ix86, x>=5.
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund, <tege@matematik.su.se>
@@ -114,3 +114,4 @@ L(2): shrl $2, %ecx /* convert byte count to longword count */
RET_PTR
#endif
END (BP_SYM (memset))
+libc_hidden_builtin_def (memset)
diff --git a/sysdeps/i386/i586/strchr.S b/sysdeps/i386/i586/strchr.S
index 02baf1c..9df504d 100644
--- a/sysdeps/i386/i586/strchr.S
+++ b/sysdeps/i386/i586/strchr.S
@@ -1,6 +1,6 @@
/* Find character CH in a NUL terminated string.
Highly optimized version for ix85, x>=5.
- Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
@@ -339,3 +339,4 @@ END (BP_SYM (strchr))
#undef index
weak_alias (BP_SYM (strchr), BP_SYM (index))
+libc_hidden_builtin_def (strchr)
diff --git a/sysdeps/i386/i586/strcpy.S b/sysdeps/i386/i586/strcpy.S
index fcfeadb..f7c1986 100644
--- a/sysdeps/i386/i586/strcpy.S
+++ b/sysdeps/i386/i586/strcpy.S
@@ -1,5 +1,5 @@
/* strcpy/stpcpy implementation for i586.
- Copyright (C) 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -159,3 +159,6 @@ L(end2):
LEAVE
RET_PTR
END (BP_SYM (STRCPY))
+#ifndef USE_AS_STPCPY
+libc_hidden_builtin_def (strcpy)
+#endif
diff --git a/sysdeps/i386/i586/strlen.S b/sysdeps/i386/i586/strlen.S
index 3415130..9ef22b0 100644
--- a/sysdeps/i386/i586/strlen.S
+++ b/sysdeps/i386/i586/strlen.S
@@ -1,6 +1,6 @@
/* strlen -- Compute length of NUL terminated string.
Highly optimized version for ix86, x>=5.
- Copyright (C) 1995, 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1995,1996,1997,2000,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
@@ -186,3 +186,4 @@ L(2): CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
LEAVE
ret
END (BP_SYM (strlen))
+libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/i386/i686/memcpy.S b/sysdeps/i386/i686/memcpy.S
index b2a7897..865967c 100644
--- a/sysdeps/i386/i686/memcpy.S
+++ b/sysdeps/i386/i686/memcpy.S
@@ -1,7 +1,7 @@
/* Copy memory block and return pointer to beginning of destination block
For Intel 80x86, x>=6.
This file is part of the GNU C Library.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
The GNU C Library is free software; you can redistribute it and/or
@@ -59,3 +59,4 @@ ENTRY (BP_SYM (memcpy))
LEAVE
RET_PTR
END (BP_SYM (memcpy))
+libc_hidden_builtin_def (memcpy)
diff --git a/sysdeps/i386/i686/memmove.S b/sysdeps/i386/i686/memmove.S
index 76fda40..421b4ef 100644
--- a/sysdeps/i386/i686/memmove.S
+++ b/sysdeps/i386/i686/memmove.S
@@ -92,3 +92,4 @@ ENTRY (BP_SYM (memmove))
LEAVE
RET_PTR
END (BP_SYM (memmove))
+libc_hidden_builtin_def (memmove)
diff --git a/sysdeps/i386/i686/memset.S b/sysdeps/i386/i686/memset.S
index be4db96..4ddcb39 100644
--- a/sysdeps/i386/i686/memset.S
+++ b/sysdeps/i386/i686/memset.S
@@ -1,6 +1,6 @@
/* memset/bzero -- set memory area to CH/0
Highly optimized version for ix86, x>=6.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
@@ -93,3 +93,4 @@ ENTRY (BP_SYM (memset))
RET_PTR
#endif
END (BP_SYM (memset))
+libc_hidden_builtin_def (memset)
diff --git a/sysdeps/i386/i686/strcmp.S b/sysdeps/i386/i686/strcmp.S
index 760d9d8..8601c1c 100644
--- a/sysdeps/i386/i686/strcmp.S
+++ b/sysdeps/i386/i686/strcmp.S
@@ -1,5 +1,5 @@
/* Highly optimized version for ix86, x>=6.
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
@@ -69,3 +69,4 @@ L(chk): CHECK_BOUNDS_HIGH (%ecx, STR1(%esp), jb)
LEAVE
ret
END (BP_SYM (strcmp))
+libc_hidden_builtin_def (strcmp)
diff --git a/sysdeps/i386/memchr.S b/sysdeps/i386/memchr.S
index 9f77198..3cfb3d6 100644
--- a/sysdeps/i386/memchr.S
+++ b/sysdeps/i386/memchr.S
@@ -1,7 +1,7 @@
/* memchr (str, chr, len) -- Return pointer to first occurrence of CHR in STR less
than LEN.
For Intel 80x86, x>=3.
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994-1998, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
@@ -330,3 +330,4 @@ weak_alias (BP_SYM (__memchr), BP_SYM (memchr))
#if !__BOUNDED_POINTERS__
weak_alias (__memchr, __ubp_memchr)
#endif
+libc_hidden_builtin_def (memchr)
diff --git a/sysdeps/i386/memset.c b/sysdeps/i386/memset.c
index 1bbed73..6a7fff8 100644
--- a/sysdeps/i386/memset.c
+++ b/sysdeps/i386/memset.c
@@ -1,6 +1,6 @@
/* Set a block of memory to some byte value.
For Intel 80x86, x>=3.
- Copyright (C) 1991, 1992, 1993, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1991,1992,1993,1997,1998,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
@@ -79,6 +79,7 @@ memset (void *dstpp, int c, size_t len)
return dstpp;
}
+libc_hidden_builtin_def (memset)
#else
#include <sysdeps/generic/memset.c>
diff --git a/sysdeps/i386/strchr.S b/sysdeps/i386/strchr.S
index f6a6de1..f5cee2f 100644
--- a/sysdeps/i386/strchr.S
+++ b/sysdeps/i386/strchr.S
@@ -1,6 +1,6 @@
/* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
- Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997,1999,2000,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
@@ -289,3 +289,4 @@ L(6):
END (BP_SYM (strchr))
weak_alias (BP_SYM (strchr), BP_SYM (index))
+libc_hidden_builtin_def (strchr)
diff --git a/sysdeps/i386/strcspn.S b/sysdeps/i386/strcspn.S
index c5f3d52..dc3a176 100644
--- a/sysdeps/i386/strcspn.S
+++ b/sysdeps/i386/strcspn.S
@@ -1,7 +1,7 @@
/* strcspn (str, ss) -- Return the length of the initial segment of STR
which contains no characters from SS.
For Intel 80x86, x>=3.
- Copyright (C) 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994,1995,1996,1997,2000,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
@@ -179,3 +179,4 @@ L(4): addl $256, %esp /* remove stopset */
LEAVE
ret
END (BP_SYM (strcspn))
+libc_hidden_builtin_def (strcspn)
diff --git a/sysdeps/i386/string-inlines.c b/sysdeps/i386/string-inlines.c
new file mode 100644
index 0000000..72a04b7
--- /dev/null
+++ b/sysdeps/i386/string-inlines.c
@@ -0,0 +1,189 @@
+/* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* <bits/string.h> and <bits/string2.h> declare some extern inline
+ functions. These functions are declared additionally here if
+ inlining is not possible. */
+
+#undef __USE_STRING_INLINES
+#define __USE_STRING_INLINES
+#define _FORCE_INLINES
+#define __STRING_INLINE /* empty */
+#define __NO_INLINE__
+
+#include <string.h>
+#undef index
+#undef rindex
+
+#undef __NO_INLINE__
+#include <bits/string.h>
+#include <bits/string2.h>
+
+/* Functions which are inlines in i486 but not i386. */
+void *
+__memcpy_by2 (void *dest, const void *src, size_t n)
+{
+ return memcpy (dest, src, n);
+}
+strong_alias (__memcpy_by2, __memcpy_by4)
+strong_alias (__memcpy_by2, __memcpy_g)
+strong_alias (__memcpy_by2, __memcpy_g_internal)
+
+void *
+__memset_ccn_by2 (void *s, unsigned int c, size_t n)
+{
+ return memset (s, c & 0xff, n);
+}
+strong_alias (__memset_ccn_by2, __memset_ccn_by4)
+
+void *
+__memset_gcn_by2 (void *s, int c, size_t n)
+{
+ return memset (s, c, n);
+}
+strong_alias (__memset_gcn_by2, __memset_gcn_by4)
+
+size_t
+__strlen_g (const char *s)
+{
+ return strlen (s);
+}
+
+char *
+__strcpy_g (char *d, const char *s)
+{
+ return strcpy (d, s);
+}
+
+char *
+__mempcpy_by2 (char *d, const char *s, size_t n)
+{
+ return mempcpy (d, s, n);
+}
+strong_alias (__mempcpy_by2, __mempcpy_by4)
+strong_alias (__mempcpy_by2, __mempcpy_byn)
+
+char *
+__stpcpy_g (char *d, const char *s)
+{
+ return stpcpy (d, s);
+}
+
+char *
+__strncpy_by2 (char *d, const char s[], size_t srclen, size_t n)
+{
+ return strncpy (d, s, n);
+}
+strong_alias (__strncpy_by2, __strncpy_by4)
+strong_alias (__strncpy_by2, __strncpy_byn)
+
+char *
+__strncpy_gg (char *d, const char *s, size_t n)
+{
+ return strncpy (d, s, n);
+}
+
+char *
+__strcat_c (char *d, const char s[], size_t srclen)
+{
+ return strcat (d, s);
+}
+
+char *
+__strcat_g (char *d, const char *s)
+{
+ return strcat (d, s);
+}
+
+char *
+__strncat_g (char *d, const char s[], size_t n)
+{
+ return strncat (d, s, n);
+}
+
+int
+__strcmp_gg (const char *s1, const char *s2)
+{
+ return strcmp (s1, s2);
+}
+
+int
+__strncmp_g (const char *s1, const char *s2, size_t n)
+{
+ return strncmp (s1, s2, n);
+}
+
+char *
+__strrchr_c (const char *s, int c)
+{
+ return strrchr (s, c >> 8);
+}
+
+char *
+__strrchr_g (const char *s, int c)
+{
+ return strrchr (s, c);
+}
+
+size_t
+__strcspn_cg (const char *s, const char reject[], size_t reject_len)
+{
+ return strcspn (s, reject);
+}
+
+size_t
+__strcspn_g (const char *s, const char *reject)
+{
+ return strcspn (s, reject);
+}
+
+size_t
+__strspn_cg (const char *s, const char accept[], size_t accept_len)
+{
+ return strspn (s, accept);
+}
+
+size_t
+__strspn_g (const char *s, const char *accept)
+{
+ return strspn (s, accept);
+}
+
+char *
+__strpbrk_cg (const char *s, const char accept[], size_t accept_len)
+{
+ return strpbrk (s, accept);
+}
+
+char *
+__strpbrk_g (const char *s, const char *accept)
+{
+ return strpbrk (s, accept);
+}
+
+char *
+__strstr_cg (const char *haystack, const char needle[], size_t needle_len)
+{
+ return strstr (haystack, needle);
+}
+
+char *
+__strstr_g (const char *haystack, const char needle[])
+{
+ return strstr (haystack, needle);
+}
diff --git a/sysdeps/i386/strlen.c b/sysdeps/i386/strlen.c
index b21414e..93bf150 100644
--- a/sysdeps/i386/strlen.c
+++ b/sysdeps/i386/strlen.c
@@ -1,5 +1,5 @@
/* Determine the length of a string. For Intel 80x86, x>=3.
- Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1991,1992,1993,1996,1997,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
@@ -33,3 +33,4 @@ strlen (const char *str)
return -2 - cnt;
}
+libc_hidden_builtin_def (strlen)
diff --git a/sysdeps/i386/strpbrk.S b/sysdeps/i386/strpbrk.S
index ddc3cee..66136c2 100644
--- a/sysdeps/i386/strpbrk.S
+++ b/sysdeps/i386/strpbrk.S
@@ -1,7 +1,7 @@
/* strcspn (str, ss) -- Return the length of the initial segement of STR
which contains no characters from SS.
For Intel 80x86, x>=3.
- Copyright (C) 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997, 2000, 2003 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
This file is part of the GNU C Library.
@@ -188,3 +188,4 @@ L(7): RETURN_BOUNDED_POINTER (STR(%esp))
LEAVE
RET_PTR
END (BP_SYM (strpbrk))
+libc_hidden_builtin_def (strpbrk)
diff --git a/sysdeps/i386/strrchr.S b/sysdeps/i386/strrchr.S
index de6a28a..0fd95b5 100644
--- a/sysdeps/i386/strrchr.S
+++ b/sysdeps/i386/strrchr.S
@@ -1,6 +1,6 @@
/* strrchr (str, ch) -- Return pointer to last occurrence of CH in STR.
For Intel 80x86, x>=3.
- Copyright (C) 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
@@ -331,3 +331,4 @@ L(2): CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
END (BP_SYM (strrchr))
weak_alias (BP_SYM (strrchr), BP_SYM (rindex))
+libc_hidden_builtin_def (strrchr)
diff --git a/sysdeps/i386/strspn.S b/sysdeps/i386/strspn.S
index 4ceb3c1..e1c109e 100644
--- a/sysdeps/i386/strspn.S
+++ b/sysdeps/i386/strspn.S
@@ -1,7 +1,7 @@
/* strcspn (str, ss) -- Return the length of the initial segment of STR
which contains only characters from SS.
For Intel 80x86, x>=3.
- Copyright (C) 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Bug fixes by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
@@ -179,3 +179,4 @@ L(4): addl $256, %esp /* remove stopset */
LEAVE
ret
END (BP_SYM (strspn))
+libc_hidden_builtin_def (strspn)