OSDN Git Service

Use strong_alias everywhere instead of .global/.set. Correct some cases where the...
authorPeter S. Mazinger <ps.m@gmx.net>
Tue, 3 Jan 2006 14:46:56 +0000 (14:46 -0000)
committerPeter S. Mazinger <ps.m@gmx.net>
Tue, 3 Jan 2006 14:46:56 +0000 (14:46 -0000)
95 files changed:
libc/string/arm/_memcpy.S
libc/string/arm/bcopy.S
libc/string/arm/bzero.S
libc/string/arm/memcmp.S
libc/string/arm/memcpy.S
libc/string/arm/memmove.S
libc/string/arm/memset.S
libc/string/arm/strcmp.S
libc/string/arm/strlen.S
libc/string/arm/strncmp.S
libc/string/frv/memcpy.S
libc/string/frv/memset.S
libc/string/generic/memchr.c
libc/string/generic/memcmp.c
libc/string/generic/memcpy.c
libc/string/generic/memmem.c
libc/string/generic/memmove.c
libc/string/generic/mempcpy.c
libc/string/generic/memrchr.c
libc/string/generic/memset.c
libc/string/generic/rawmemchr.c
libc/string/generic/strcat.c
libc/string/generic/strchr.c
libc/string/generic/strchrnul.c
libc/string/generic/strcmp.c
libc/string/generic/strcpy.c
libc/string/generic/strcspn.c
libc/string/generic/strlen.c
libc/string/generic/strncat.c
libc/string/generic/strncmp.c
libc/string/generic/strncpy.c
libc/string/generic/strnlen.c
libc/string/generic/strrchr.c
libc/string/generic/strsep.c
libc/string/generic/strspn.c
libc/string/generic/strstr.c
libc/string/generic/strtok_r.c
libc/string/i386/memchr.c
libc/string/i386/memcpy.c
libc/string/i386/memmove.c
libc/string/i386/memset.c
libc/string/i386/strcat.c
libc/string/i386/strchr.c
libc/string/i386/strcmp.c
libc/string/i386/strcpy.c
libc/string/i386/strlen.c
libc/string/i386/strncat.c
libc/string/i386/strncmp.c
libc/string/i386/strncpy.c
libc/string/i386/strnlen.c
libc/string/i386/strrchr.c
libc/string/mips/memcpy.S
libc/string/mips/memset.S
libc/string/mips/sysdep.h
libc/string/powerpc/memcpy.c
libc/string/powerpc/memmove.c
libc/string/powerpc/memset.c
libc/string/sh64/memcpy.S
libc/string/sh64/memset.S
libc/string/sh64/strcpy.S
libc/string/sh64/strlen.S
libc/string/sparc/_glibc_inc.h
libc/string/sparc/sparc32/memchr.S
libc/string/sparc/sparc32/memcpy.S
libc/string/sparc/sparc32/memset.S
libc/string/sparc/sparc32/stpcpy.S
libc/string/sparc/sparc32/strcat.S
libc/string/sparc/sparc32/strchr.S
libc/string/sparc/sparc32/strcmp.S
libc/string/sparc/sparc32/strcpy.S
libc/string/sparc/sparc32/strlen.S
libc/string/sparc/sparc64/memchr.S
libc/string/sparc/sparc64/memcpy.S
libc/string/sparc/sparc64/memset.S
libc/string/sparc/sparc64/sparcv9b/memcpy.S
libc/string/sparc/sparc64/stpcpy.S
libc/string/sparc/sparc64/strcat.S
libc/string/sparc/sparc64/strchr.S
libc/string/sparc/sparc64/strcmp.S
libc/string/sparc/sparc64/strcpy.S
libc/string/sparc/sparc64/strlen.S
libc/string/x86_64/_glibc_inc.h
libc/string/x86_64/bzero.S
libc/string/x86_64/memcpy.S
libc/string/x86_64/mempcpy.S [new file with mode: 0644]
libc/string/x86_64/memset.S
libc/string/x86_64/stpcpy.S
libc/string/x86_64/strcat.S
libc/string/x86_64/strchr.S
libc/string/x86_64/strcmp.S
libc/string/x86_64/strcpy.S
libc/string/x86_64/strcspn.S
libc/string/x86_64/strlen.S
libc/string/x86_64/strpbrk.S
libc/string/x86_64/strspn.S

index 236500e..e8d78af 100644 (file)
@@ -73,6 +73,7 @@
 
 .text
 .global _memcpy
+.hidden _memcpy
 .type _memcpy,%function
 .align 4
 
index a028075..2914b89 100644 (file)
@@ -39,8 +39,8 @@
 
 /* bcopy = memcpy/memmove with arguments reversed. */
 
-.global bcopy
-.set bcopy,__bcopy
+#include <features.h>
+
 .text
 .global __bcopy
 .hidden __bcopy
@@ -55,3 +55,5 @@ __bcopy:
        b       _memcpy (PLT)
        
 .size __bcopy,.-__bcopy
+
+strong_alias(__bcopy,bcopy)
index 93582f7..2cb6709 100644 (file)
  * by Erik Andersen <andersen@codepoet.org>
  */
 
+#include <features.h>
+
 .text
 .global __bzero
+.hidden __bzero
 .type __bzero,%function
 .align 4
 
 __bzero:
        mov     r2, r1
        mov     r1, #0
-       b       memset (PLT)
+       b       __memset
 
 .size __bzero,.-__bzero
 
-.weak bzero ; bzero = __bzero
+strong_alias(__bzero,bzero)
index bdb5aca..a97e027 100644 (file)
@@ -29,9 +29,8 @@
  * by Erik Andersen <andersen@codepoet.org>
  */
 
+#include <features.h>
 
-.global memcmp
-.set memcmp,__memcmp
 .text
 .global __memcmp
 .hidden __memcmp
@@ -56,4 +55,6 @@ __memcmp:
        mov     pc, lr
 
 .size __memcmp,.-__memcmp
-.weak bcmp ; bcmp = memcmp
+
+strong_alias(__memcmp,memcmp)
+strong_alias(__memcmp,bcmp)
index 372da4c..8f81a15 100644 (file)
@@ -37,8 +37,8 @@
  * by Erik Andersen <andersen@codepoet.org>
  */
 
-.global memcpy
-.set memcpy,__memcpy
+#include <features.h>
+
 .text
 .global __memcpy
 .hidden __memcpy
@@ -47,7 +47,9 @@
 
 __memcpy:
        stmfd   sp!, {r0, lr}
-       bl      _memcpy (PLT)
+       bl      _memcpy
        ldmfd   sp!, {r0, pc}
 
 .size __memcpy,.-__memcpy
+
+strong_alias(__memcpy,memcpy)
index eafd345..a26cf73 100644 (file)
@@ -37,8 +37,8 @@
  * by Erik Andersen <andersen@codepoet.org>
  */
 
-.global memmove
-.set memmove,__memmove
+#include <features.h>
+
 .text
 .global __memmove
 .hidden __memmove
@@ -47,7 +47,9 @@
 
 __memmove:
        stmfd   sp!, {r0, lr}
-       bl      _memcpy (PLT)
+       bl      _memcpy
        ldmfd   sp!, {r0, pc}
 
 .size __memmove,.-__memmove
+
+strong_alias(__memmove,memmove)
index 5fca03a..dea05a6 100644 (file)
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <features.h>
 #include <sys/syscall.h>
 
-.global memset
-.set memset,__memset
 .text
 .global __memset
 .hidden __memset
@@ -72,3 +71,5 @@ __memset:
        mov     pc, lr
 
 .size __memset,.-__memset
+
+strong_alias(__memset,memset)
index 33acc14..3f462de 100644 (file)
@@ -31,8 +31,6 @@
 
 #include <features.h>
 
-.global strcmp
-.set strcmp,__strcmp
 .text
 .global __strcmp
 .hidden __strcmp
@@ -50,7 +48,9 @@ __strcmp:
        mov     pc, lr
 
 .size __strcmp,.-__strcmp
+
+strong_alias(__strcmp,strcmp)
 #ifndef __UCLIBC_HAS_LOCALE__
-.global __strcoll ; .hidden __strcoll ; __strcoll = __strcmp
-.global strcoll ; .set strcoll,__strcmp
+hidden_strong_alias(__strcmp,__strcoll)
+strong_alias(__strcmp,strcoll)
 #endif
index 7d91fd0..f623cbe 100644 (file)
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <features.h>
 #include <endian.h>
 #include <sys/syscall.h>
 
@@ -25,8 +26,6 @@
  * exit: r0 = len
  */
 
-.global strlen
-.set strlen,__strlen
 .text
 .global __strlen
 .hidden __strlen
@@ -80,3 +79,5 @@ Llastword:                            @ drop through to here once we find a
        mov     pc,lr
 
 .size __strlen,.-__strlen
+
+strong_alias(__strlen,strlen)
index 94e93f7..a327872 100644 (file)
@@ -29,8 +29,8 @@
  * by Erik Andersen <andersen@codepoet.org>
  */
 
-.global strncmp
-.set strncmp,__strncmp
+#include <features.h>
+
 .text
 .global __strncmp
 .hidden __strncmp
@@ -57,3 +57,5 @@ __strncmp:
        mov     pc, lr
 
 .size __strncmp,.-__strncmp
+
+strong_alias(__strncmp,strncmp)
index 1ffc7c3..abd8a28 100644 (file)
@@ -18,6 +18,7 @@
  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <features.h>
 
         .text
         .p2align       4
@@ -30,8 +31,6 @@
 #         to caller's fixup routine, aborting the remainder of the copy
 #
 ###############################################################################
-        .globl         memcpy
-       .set            memcpy,__memcpy
         .globl         __memcpy
         .hidden                __memcpy
         .type          __memcpy,@function
@@ -125,3 +124,5 @@ memcpy_32:
        bralr
 
        .size           __memcpy, .-__memcpy
+
+strong_alias(__memcpy,memcpy)
index 62e705a..a548b37 100644 (file)
@@ -18,6 +18,7 @@
  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <features.h>
 
         .text
         .p2align       4
@@ -31,8 +32,6 @@
 #         GR4, GR7, GR8, and GR11 must be managed
 #
 ###############################################################################
-        .globl         memset
-       .set            memset,__memset
         .globl         __memset
         .hidden                __memset
         .type          __memset,@function
@@ -156,3 +155,5 @@ __memset:
        cstb.p          gr12,@(gr4,gr0)         ,cc7,#1
        bralr
        .size           __memset, .-__memset
+
+strong_alias(__memset,memset)
index bc0623f..68c8208 100644 (file)
@@ -29,8 +29,6 @@
 
 #define LONG_MAX_32_BITS 2147483647
 
-#undef memchr
-
 /* Search no more than N bytes of S for C.  */
 void attribute_hidden *__memchr (const void * s, int c_in, size_t n)
 {
@@ -174,4 +172,4 @@ void attribute_hidden *__memchr (const void * s, int c_in, size_t n)
   return 0;
 }
 
-strong_alias(__memchr, memchr)
+strong_alias(__memchr,memchr)
index a3fcba0..13e1169 100644 (file)
@@ -20,8 +20,6 @@
 
 #include <string.h>
 
-#undef memcmp
-
 #include "memcopy.h"
 
 #include <endian.h>
@@ -332,6 +330,6 @@ attribute_hidden __memcmp (const __ptr_t s1, const __ptr_t s2, size_t len)
   return 0;
 }
 
-strong_alias(__memcmp, memcmp)
+strong_alias(__memcmp,memcmp)
 
-weak_alias(memcmp, bcmp)
+strong_alias(__memcmp,bcmp)
index 2fb48eb..6db4d0d 100644 (file)
@@ -23,8 +23,6 @@
 #include "memcopy.h"
 #include "pagecopy.h"
 
-#undef memcpy
-
 /* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
    block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
    Both SRCP and DSTP should be aligned for memory operations on `op_t's.  */
@@ -245,4 +243,4 @@ void attribute_hidden *__memcpy (void *dstpp, const void *srcpp, size_t len)
   return dstpp;
 }
 
-strong_alias(__memcpy, memcpy)
+strong_alias(__memcpy,memcpy)
index 05d7de6..0353759 100644 (file)
@@ -19,8 +19,6 @@
 #include <string.h>
 #include <stddef.h>
 
-#undef memmem
-
 /* Return the first occurrence of NEEDLE in HAYSTACK.  */
 void attribute_hidden *__memmem (const void *haystack, size_t haystack_len,
                          const void *needle,  size_t needle_len)
@@ -49,4 +47,4 @@ void attribute_hidden *__memmem (const void *haystack, size_t haystack_len,
   return NULL;
 }
 
-strong_alias(__memmem, memmem)
+strong_alias(__memmem,memmem)
index 0e649a1..e34b000 100644 (file)
@@ -206,8 +206,6 @@ static void _wordcopy_bwd_dest_aligned (long int dstp, long int srcp, size_t len
   ((op_t *) dstp)[3] = MERGE (a0, sh_1, a1, sh_2);
 }
 
-#undef memmove
-
 void attribute_hidden *__memmove (void *dest, const void *src, size_t len)
 {
   unsigned long int dstp = (long int) dest;
@@ -279,4 +277,4 @@ void attribute_hidden *__memmove (void *dest, const void *src, size_t len)
   return (dest);
 }
 
-strong_alias(__memmove, memmove)
+strong_alias(__memmove,memmove)
index f2c8601..d121967 100644 (file)
@@ -7,8 +7,6 @@
 
 #include <string.h>
 
-#undef mempcpy
-
 void attribute_hidden *__mempcpy (void *dstpp, const void *srcpp, size_t len)
 {
   __memcpy(dstpp, srcpp, len);
index 3f75839..d27ae03 100644 (file)
@@ -30,8 +30,6 @@
 
 #define LONG_MAX_32_BITS 2147483647
 
-#undef memrchr
-
 /* Search no more than N bytes of S for C.  */
 void attribute_hidden *__memrchr (const void * s, int c_in, size_t n)
 {
@@ -173,4 +171,4 @@ void attribute_hidden *__memrchr (const void * s, int c_in, size_t n)
   return 0;
 }
 
-strong_alias(__memrchr, memrchr)
+strong_alias(__memrchr,memrchr)
index 0185ad5..91401d7 100644 (file)
@@ -19,8 +19,6 @@
 #include <string.h>
 #include "memcopy.h"
 
-#undef memset
-
 void attribute_hidden *__memset (void *dstpp, int c, size_t len)
 {
   long int dstp = (long int) dstpp;
@@ -85,4 +83,4 @@ void attribute_hidden *__memset (void *dstpp, int c, size_t len)
   return dstpp;
 }
 
-strong_alias(__memset, memset)
+strong_alias(__memset,memset)
index 02cb8f6..d1be620 100644 (file)
@@ -29,8 +29,6 @@
 
 #define LONG_MAX_32_BITS 2147483647
 
-#undef rawmemchr
-
 /* Find the first occurrence of C in S.  */
 void attribute_hidden *__rawmemchr (const void * s, int c_in)
 {
@@ -159,4 +157,4 @@ void attribute_hidden *__rawmemchr (const void * s, int c_in)
     }
 }
 
-strong_alias(__rawmemchr, rawmemchr)
+strong_alias(__rawmemchr,rawmemchr)
index 0996f9a..96412ac 100644 (file)
@@ -19,8 +19,6 @@
 #include <string.h>
 #include "memcopy.h"
 
-#undef strcat
-
 /* Append SRC on the end of DEST.  */
 char attribute_hidden *__strcat (char *dest, const char *src)
 {
@@ -47,4 +45,4 @@ char attribute_hidden *__strcat (char *dest, const char *src)
   return dest;
 }
 
-strong_alias(__strcat, strcat)
+strong_alias(__strcat,strcat)
index c776380..dcb30ad 100644 (file)
@@ -26,8 +26,6 @@
 
 #include "memcopy.h"
 
-#undef strchr
-
 /* Find the first occurrence of C in S.  */
 char attribute_hidden *__strchr (const char *s, int c_in)
 {
@@ -181,6 +179,6 @@ char attribute_hidden *__strchr (const char *s, int c_in)
   return NULL;
 }
 
-strong_alias(__strchr, strchr)
+strong_alias(__strchr,strchr)
 
-weak_alias(strchr, index)
+strong_alias(__strchr,index)
index faa0f4f..a2aafbf 100644 (file)
@@ -26,8 +26,6 @@
 
 #include "memcopy.h"
 
-#undef strchrnul
-
 /* Find the first occurrence of C in S or the final NUL byte.  */
 char attribute_hidden *__strchrnul (const char *s, int c_in)
 {
@@ -164,4 +162,4 @@ char attribute_hidden *__strchrnul (const char *s, int c_in)
   return NULL;
 }
 
-strong_alias(__strchrnul, strchrnul)
+strong_alias(__strchrnul,strchrnul)
index f124242..209aeed 100644 (file)
    02111-1307 USA.  */
 
 #include <string.h>
-#include <locale.h>
 
 #include "memcopy.h"
 
-#undef strcmp
-
 /* Compare S1 and S2, returning less than, equal to or
    greater than zero if S1 is lexicographically less than,
    equal to or greater than S2.  */
@@ -44,9 +41,9 @@ int attribute_hidden __strcmp (const char *p1, const char *p2)
   return c1 - c2;
 }
 
-strong_alias(__strcmp, strcmp)
+strong_alias(__strcmp,strcmp)
 
-#ifdef __LOCALE_C_ONLY
-hidden_strong_alias(__strcmp, __strcoll)
-strong_alias(__strcmp, strcoll)
-#endif /* __LOCALE_C_ONLY */
+#ifndef __UCLIBC_HAS_LOCALE__
+hidden_strong_alias(__strcmp,__strcoll)
+strong_alias(__strcmp,strcoll)
+#endif
index 08c810f..9280d35 100644 (file)
@@ -22,8 +22,6 @@
 #include "memcopy.h"
 #include "bp-checks.h"
 
-#undef strcpy
-
 /* Copy SRC to DEST.  */
 char attribute_hidden *__strcpy (char *dest, const char *src)
 {
@@ -46,4 +44,4 @@ char attribute_hidden *__strcpy (char *dest, const char *src)
   return dest;
 }
 
-strong_alias(__strcpy, strcpy)
+strong_alias(__strcpy,strcpy)
index a10912e..a06577b 100644 (file)
@@ -18,8 +18,6 @@
 
 #include <string.h>
 
-#undef strcspn
-
 /* Return the length of the maximum initial segment of S
    which contains no characters from REJECT.  */
 size_t attribute_hidden __strcspn (const char *s, const char *reject)
@@ -35,4 +33,4 @@ size_t attribute_hidden __strcspn (const char *s, const char *reject)
   return count;
 }
 
-strong_alias(__strcspn, strcspn)
+strong_alias(__strcspn,strcspn)
index aca8c2b..6c1b5ea 100644 (file)
@@ -22,8 +22,6 @@
 #include <string.h>
 #include <stdlib.h>
 
-#undef strlen
-
 /* Return the length of the null-terminated string STR.  Scan for
    the null terminator quickly by testing four bytes at a time.  */
 size_t attribute_hidden __strlen (const char *str)
@@ -149,4 +147,4 @@ size_t attribute_hidden __strlen (const char *str)
     }
 }
 
-strong_alias(__strlen, strlen)
+strong_alias(__strlen,strlen)
index f35e086..5ece4d2 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "memcopy.h"
 
-#undef strncat
-
 char attribute_hidden *__strncat (char *s1, const char *s2, size_t n)
 {
   reg_char c;
@@ -76,4 +74,4 @@ char attribute_hidden *__strncat (char *s1, const char *s2, size_t n)
   return s;
 }
 
-strong_alias(__strncat, strncat)
+strong_alias(__strncat,strncat)
index 22aa179..849726f 100644 (file)
@@ -19,8 +19,6 @@
 #include <string.h>
 #include "memcopy.h"
 
-#undef strncmp
-
 /* Compare no more than N characters of S1 and S2,
    returning less than, equal to or greater than zero
    if S1 is lexicographically less than, equal to or
@@ -67,4 +65,4 @@ int attribute_hidden __strncmp (const char *s1, const char *s2, size_t n)
   return c1 - c2;
 }
 
-strong_alias(__strncmp, strncmp)
+strong_alias(__strncmp,strncmp)
index a43c485..ca4f59e 100644 (file)
@@ -19,8 +19,6 @@
 #include <string.h>
 #include "memcopy.h"
 
-#undef strncpy
-
 char attribute_hidden *__strncpy (char *s1, const char *s2, size_t n)
 {
   reg_char c;
@@ -81,4 +79,4 @@ char attribute_hidden *__strncpy (char *s1, const char *s2, size_t n)
   return s;
 }
 
-strong_alias(__strncpy, strncpy)
+strong_alias(__strncpy,strncpy)
index ff5c137..4b96dde 100644 (file)
@@ -24,8 +24,6 @@
 #include <string.h>
 #include <stdlib.h>
 
-#undef strnlen
-
 /* Find the length of S, but scan at most MAXLEN characters.  If no
    '\0' terminator is found in that many characters, return MAXLEN.  */
 size_t attribute_hidden __strnlen (const char *str, size_t maxlen)
@@ -159,4 +157,4 @@ size_t attribute_hidden __strnlen (const char *str, size_t maxlen)
   return char_ptr - str;
 }
 
-strong_alias(__strnlen, strnlen)
+strong_alias(__strnlen,strnlen)
index 325be7d..529016e 100644 (file)
@@ -18,8 +18,6 @@
 
 #include <string.h>
 
-#undef strrchr
-
 /* Find the last occurrence of C in S.  */
 char attribute_hidden *__strrchr (const char *s, int c)
 {
@@ -42,6 +40,6 @@ char attribute_hidden *__strrchr (const char *s, int c)
   return (char *) found;
 }
 
-strong_alias(__strrchr, strrchr)
+strong_alias(__strrchr,strrchr)
 
-weak_alias (strrchr, rindex)
+strong_alias (__strrchr,rindex)
index 9515fa1..762b07f 100644 (file)
@@ -20,8 +20,6 @@
 
 #include <string.h>
 
-#undef strsep
-
 char attribute_hidden *__strsep (char **stringp, const char *delim)
 {
   char *begin, *end;
@@ -66,4 +64,4 @@ char attribute_hidden *__strsep (char **stringp, const char *delim)
   return begin;
 }
 
-strong_alias(__strsep, strsep)
+strong_alias(__strsep,strsep)
index 1923f8a..129c587 100644 (file)
@@ -18,8 +18,6 @@
 
 #include <string.h>
 
-#undef strspn
-
 /* Return the length of the maximum initial segment
    of S which contains only characters in ACCEPT.  */
 size_t attribute_hidden __strspn (const char *s, const char *accept)
@@ -42,4 +40,4 @@ size_t attribute_hidden __strspn (const char *s, const char *accept)
   return count;
 }
 
-strong_alias(__strspn, strspn)
+strong_alias(__strspn,strspn)
index b16261e..12e3840 100644 (file)
@@ -30,8 +30,6 @@
 
 typedef unsigned chartype;
 
-#undef strstr
-
 char attribute_hidden *__strstr (const char *phaystack, const char *pneedle)
 {
   const unsigned char *haystack, *needle;
@@ -112,4 +110,4 @@ ret0:
   return 0;
 }
 
-strong_alias(__strstr, strstr)
+strong_alias(__strstr,strstr)
index 56eb64b..1a11166 100644 (file)
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define rawmemchr __rawmemchr
-#define strspn __strspn
-#define strpbrk __strpbrk
-
 #define _GNU_SOURCE
 #include <string.h>
 
-#undef strtok_r
-
 /* Parse S into tokens separated by characters in DELIM.
    If S is NULL, the saved pointer in SAVE_PTR is used as
    the next starting point.  For example:
@@ -44,7 +38,7 @@ char attribute_hidden *__strtok_r (char *s, const char *delim, char **save_ptr)
     s = *save_ptr;
 
   /* Scan leading delimiters.  */
-  s += strspn (s, delim);
+  s += __strspn (s, delim);
   if (*s == '\0')
     {
       *save_ptr = s;
@@ -53,10 +47,10 @@ char attribute_hidden *__strtok_r (char *s, const char *delim, char **save_ptr)
 
   /* Find the end of the token.  */
   token = s;
-  s = strpbrk (token, delim);
+  s = __strpbrk (token, delim);
   if (s == NULL)
     /* This token finishes the string.  */
-    *save_ptr = rawmemchr (token, '\0');
+    *save_ptr = __rawmemchr (token, '\0');
   else
     {
       /* Terminate the token and make *SAVE_PTR point past it.  */
@@ -66,4 +60,4 @@ char attribute_hidden *__strtok_r (char *s, const char *delim, char **save_ptr)
   return token;
 }
 
-strong_alias(__strtok_r, strtok_r)
+strong_alias(__strtok_r,strtok_r)
index 5994a4b..c7cd337 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef memchr
 void attribute_hidden *__memchr(const void *cs, int c, size_t count)
 {
     int d0;
@@ -49,4 +48,4 @@ void attribute_hidden *__memchr(const void *cs, int c, size_t count)
     return __res;
 }
 
-strong_alias(__memchr, memchr)
+strong_alias(__memchr,memchr)
index 1cd2346..12ba8d7 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef memcpy
 void attribute_hidden *__memcpy(void * to, const void * from, size_t n)
 {
     int d0, d1, d2;
@@ -51,4 +50,4 @@ void attribute_hidden *__memcpy(void * to, const void * from, size_t n)
     return (to);
 }
 
-strong_alias(__memcpy, memcpy)
+strong_alias(__memcpy,memcpy)
index 4bc5f3e..d6e29e5 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef memmove
 void attribute_hidden *__memmove(void *dest, const void *src, size_t n)
 {
     int d0, d1, d2;
@@ -57,4 +56,4 @@ void attribute_hidden *__memmove(void *dest, const void *src, size_t n)
     return dest;
 }
 
-strong_alias(__memmove, memmove)
+strong_alias(__memmove,memmove)
index 0fd9e20..eadbf9f 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef memset
 void attribute_hidden *__memset(void *s, int c, size_t count)
 {
     int d0, d1;
@@ -45,4 +44,4 @@ void attribute_hidden *__memset(void *s, int c, size_t count)
     return s;
 }
 
-strong_alias(__memset, memset)
+strong_alias(__memset,memset)
index eb3c81e..02b2a3c 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef strcat
 char attribute_hidden *__strcat(char * dest, const char * src)
 {
     int d0, d1, d2, d3;
@@ -49,4 +48,4 @@ char attribute_hidden *__strcat(char * dest, const char * src)
     return dest;
 }
 
-strong_alias(__strcat, strcat)
+strong_alias(__strcat,strcat)
index 5fe689d..a8343fa 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef strchr
 char attribute_hidden *__strchr(const char *s, int c)
 {
     int d0;
@@ -51,6 +50,6 @@ char attribute_hidden *__strchr(const char *s, int c)
     return __res;
 }
 
-strong_alias(__strchr, strchr)
+strong_alias(__strchr,strchr)
 
-weak_alias(strchr, index)
+strong_alias(__strchr,index)
index 3786d59..f335da6 100644 (file)
@@ -31,9 +31,7 @@
  */
 
 #include <string.h>
-#include <locale.h> /* for __LOCALE_C_ONLY */
 
-#undef strcmp
 int attribute_hidden __strcmp(const char *cs, const char *ct)
 {
     int d0, d1;
@@ -54,9 +52,9 @@ int attribute_hidden __strcmp(const char *cs, const char *ct)
     return __res;
 }
 
-strong_alias(__strcmp, strcmp)
+strong_alias(__strcmp,strcmp)
 
-#ifdef __LOCALE_C_ONLY
-hidden_strong_alias(__strcmp, __strcoll)
-strong_alias(__strcmp, strcoll)
-#endif /* __LOCALE_C_ONLY */
+#ifndef __UCLIBC_HAS_LOCALE__
+hidden_strong_alias(__strcmp,__strcoll)
+strong_alias(__strcmp,strcoll)
+#endif
index 1b9bcfd..59effd4 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef strcpy
 char attribute_hidden *__strcpy(char * dest, const char * src)
 {
     int d0, d1, d2;
@@ -46,4 +45,4 @@ char attribute_hidden *__strcpy(char * dest, const char * src)
     return dest;
 }
 
-strong_alias(__strcpy, strcpy)
+strong_alias(__strcpy,strcpy)
index 859d092..01cc46f 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef strlen
 size_t attribute_hidden __strlen(const char *s)
 {
     int d0;
@@ -46,4 +45,4 @@ size_t attribute_hidden __strlen(const char *s)
     return __res;
 }
 
-strong_alias(__strlen, strlen)
+strong_alias(__strlen,strlen)
index b575681..b55b87b 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef strncat
 char attribute_hidden *__strncat(char * dest, 
        const char * src, size_t count)
 {
@@ -59,4 +58,4 @@ char attribute_hidden *__strncat(char * dest,
     return dest;
 }
 
-strong_alias(__strncat, strncat)
+strong_alias(__strncat,strncat)
index 825980d..2e22bf6 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef strncmp
 int attribute_hidden __strncmp(const char *cs, const char *ct, size_t count)
 {
     register int __res;
@@ -56,4 +55,4 @@ int attribute_hidden __strncmp(const char *cs, const char *ct, size_t count)
     return __res;
 }
 
-strong_alias(__strncmp, strncmp)
+strong_alias(__strncmp,strncmp)
index db135ee..272c60e 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef strncpy
 char attribute_hidden *__strncpy(char * dest, const char * src, size_t count)
 {
     int d0, d1, d2, d3;
@@ -54,4 +53,4 @@ char attribute_hidden *__strncpy(char * dest, const char * src, size_t count)
     return dest;
 }
 
-strong_alias(__strncpy, strncpy)
+strong_alias(__strncpy,strncpy)
index 4fceedf..ef5c83a 100644 (file)
@@ -33,7 +33,6 @@
 #define _GNU_SOURCE
 #include <string.h>
 
-#undef strnlen
 size_t attribute_hidden __strnlen(const char *s, size_t count)
 {
     int d0;
@@ -53,4 +52,4 @@ size_t attribute_hidden __strnlen(const char *s, size_t count)
     return __res;
 }
 
-strong_alias(__strnlen, strnlen)
+strong_alias(__strnlen,strnlen)
index 8468ee5..9f0f65a 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <string.h>
 
-#undef strrchr
 char attribute_hidden *__strrchr(const char *s, int c)
 {
     int d0, d1;
@@ -49,6 +48,6 @@ char attribute_hidden *__strrchr(const char *s, int c)
     return __res;
 }
 
-strong_alias(__strrchr, strrchr)
+strong_alias(__strrchr,strrchr)
 
-weak_alias(strrchr, rindex)
+strong_alias(__strrchr,rindex)
index 369c82f..2e42b17 100644 (file)
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <features.h>
 /*#include <sysdep.h>*/
 #include <endian.h>
 #include "sysdep.h"
@@ -39,7 +40,7 @@
 #  define SWLO swl             /* low part is left in little-endian    */
 #endif
 
-ENTRY (memcpy)
+ENTRY (__memcpy)
        .set    noreorder
 
        slti    t0, a2, 8               # Less than 8?
@@ -136,5 +137,6 @@ L(shfth):
        move    a2, t0
 
        .set    reorder
-END (memcpy)
-libc_hidden_builtin_def (memcpy)
+END (__memcpy)
+
+strong_alias(__memcpy,memcpy)
index 0919fb8..4269ebc 100644 (file)
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <features.h>
 /*#include <sysdep.h>*/
 #include <endian.h>
 #include "sysdep.h"
@@ -33,7 +34,7 @@
 # define SWHI  swr             /* high part is right in little-endian  */
 #endif
 
-ENTRY (memset)
+ENTRY (__memset)
        .set    noreorder
 
        slti    t1, a2, 8               # Less than 8?
@@ -86,5 +87,6 @@ L(exit):
        nop
 
        .set    reorder
-END (memset)
-libc_hidden_builtin_def (memset)
+END (__memset)
+
+strong_alias(__memset,memset)
index 89674fe..27518ac 100644 (file)
@@ -27,6 +27,7 @@
 
 #define ENTRY(name) \
   .globl name;                                                                \
+  .hidden name;                                                               \
   .align 2;                                                                   \
   .ent name,0;                                                                \
   name##:
 # define L(label) .L ## label
 #endif
 
-#ifdef libc_hidden_builtin_def
-#error "WHOA!!! libc_hidden_builtin_def is defined"
-#else
-#define libc_hidden_builtin_def(name) .global __ ## name ; __ ## name = name
-#endif
-
 #endif
index 34573b2..5af9686 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <string.h>
 
-#undef memcpy
 void attribute_hidden *__memcpy(void *to, const void *from, size_t n)
 /* PPC can do pre increment and load/store, but not post increment and load/store.
    Therefore use *++ptr instead of *ptr++. */
@@ -78,4 +77,4 @@ void attribute_hidden *__memcpy(void *to, const void *from, size_t n)
        goto lessthan8;
 }
 
-strong_alias(__memcpy, memcpy)
+strong_alias(__memcpy,memcpy)
index b5b70c9..1d513a9 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <string.h>
 
-#undef memmove
 void attribute_hidden *__memmove(void *to, const void *from, size_t n)
 {
        unsigned long rem, chunks, tmp1, tmp2;
@@ -74,4 +73,4 @@ void attribute_hidden *__memmove(void *to, const void *from, size_t n)
        goto lessthan8;
 }
 
-strong_alias(__memmove, memmove)
+strong_alias(__memmove,memmove)
index 3720477..f6cda95 100644 (file)
@@ -32,7 +32,6 @@ static inline int expand_byte_word(int c){
        return c;
 }
 
-#undef memset
 void attribute_hidden *__memset(void *to, int c, size_t n)
 {
        unsigned long rem, chunks;
@@ -80,4 +79,4 @@ void attribute_hidden *__memset(void *to, int c, size_t n)
        goto lessthan8;
 }
 
-strong_alias(__memset, memset)
+strong_alias(__memset,memset)
index 0ee386a..d749806 100644 (file)
 !     enirety if at least one byte is included in the copy.
 !
 
+#include <features.h>
+
        .section .text..SHmedia32,"ax"
-       .globl  memcpy
-       .set    memcpy,__memcpy
        .globl  __memcpy
        .hidden __memcpy
        .type   __memcpy, @function
-
        .align  5
+
 __memcpy:
 
 #define LDUAQ(P,O,D0,D1) ldlo.q P,O,D0; ldhi.q P,O+7,D1
@@ -202,3 +202,5 @@ Loop_ua:
        blink tr1, r63
 
        .size __memcpy,.-__memcpy
+
+strong_alias(__memcpy,memcpy)
index d878797..cd2ad79 100644 (file)
@@ -9,6 +9,7 @@
 ! Copyright 2002 SuperH Ltd.
 !
 
+#include <features.h>
 #include <endian.h>
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -20,8 +21,6 @@
 #endif
 
        .section .text..SHmedia32,"ax"
-       .globl  memset
-       .set    memset,__memset
        .globl  __memset
        .hidden __memset
        .type   __memset, @function
@@ -94,3 +93,5 @@ loop:
        blink tr2,r63
 
        .size   __memset,.-__memset
+
+strong_alias(__memset,memset)
index f662cc8..2ce9982 100644 (file)
@@ -6,6 +6,7 @@
 !
 ! SH5 code Copyright 2002 SuperH Ltd.
 
+#include <features.h>
 #include <endian.h>
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #endif
 
        .section .text..SHmedia32,"ax"
-       .globl  strcpy
-       .set    strcpy,__strcpy
        .globl  __strcpy
        .hidden __strcpy
        .type   __strcpy, @function
-
        .align 5
+
 __strcpy:
 
        pta/l shortstring,tr1
@@ -100,3 +99,5 @@ loop:
        blink tr1, r63 // shortstring
 
        .size   __strcpy,.-__strcpy
+
+strong_alias(__strcpy,strcpy)
index 0f99488..673a34d 100644 (file)
@@ -30,9 +30,9 @@
  * SUCH DAMAGE.
  */
 
+#include <features.h>
+
        .section .text..SHmedia32,"ax"
-       .globl  strlen
-       .set    strlen,__strlen
        .globl  __strlen
        .hidden __strlen
        .type   __strlen,@function
@@ -60,3 +60,5 @@ loop:
        blink   tr4, r63
 
        .size   __strlen,.-__strlen
+
+strong_alias(__strlen,strlen)
index 7840ba1..6ef1dbd 100644 (file)
@@ -14,6 +14,7 @@
 
 #define ENTRY(sym) \
        .global sym; \
+       .hidden sym; \
        .align  ENTRY_ALIGN; \
        .type   sym,%function; \
        sym:
@@ -23,8 +24,3 @@
 
 #define END(sym) \
        .size sym,.-sym;
-
-#undef weak_alias
-#define weak_alias(sym, alias) \
-       .weak alias; \
-    alias = sym;
index e8f44f1..e012844 100644 (file)
@@ -63,9 +63,6 @@
 1:     retl
         sub            %o0, 1, %o0
 
-.globl memchr
-.set memchr,__memchr
-.hidden __memchr
 ENTRY(__memchr)
        andcc           %o1, 0xff, %o1
        sll             %o1, 8, %g6
@@ -140,7 +137,8 @@ ENTRY(__memchr)
 4:     retl
         sub            %o0, 4, %o0
 END(__memchr)
+strong_alias(__memchr,memchr)
 
 #if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
+weak_alias(__memchr,__ubp_memchr)
 #endif
index b2a9b16..a1dd246 100644 (file)
        b               3f
         sub            %o0, 2, %o0
 
-.globl bcopy
-.set bcopy,__bcopy
-.hidden __bcopy
 ENTRY(__bcopy)
        mov             %o0, %o3
        mov             %o1, %o0
        mov             %o3, %o1
 END(__bcopy)
+strong_alias(__bcopy,bcopy)
 
-.globl memmove
-.set memmove,__memmove
-.hidden __memmove
 ENTRY(__memmove)
        cmp             %o0, %o1
        st              %o0, [%sp + 64]
@@ -454,10 +449,8 @@ ENTRY(__memmove)
        b               3f
         add            %o0, 2, %o0
 END(__memmove)
+strong_alias(__memmove,memmove)
 
-.globl memcpy
-.set memcpy,__memcpy
-.hidden __memcpy
 ENTRY(__memcpy)                /* %o0=dst %o1=src %o2=len */
        sub             %o0, %o1, %o4
        st              %o0, [%sp + 64]
@@ -974,3 +967,4 @@ ENTRY(__memcpy)             /* %o0=dst %o1=src %o2=len */
 110:   retl
         sub            %o7, %g6, %o5
 END(__memcpy)
+strong_alias(__memcpy,memcpy)
index ef8a5b6..b60b881 100644 (file)
@@ -61,10 +61,8 @@ ENTRY(__bzero)
        b               4f
         sub            %o0, %o2, %o0
 END(__bzero)
+strong_alias(__bzero,bzero)
 
-.globl memset
-.set memset,__memset
-.hidden __memset
 ENTRY(__memset)
        and             %o1, 0xff, %g3
        sll             %g3, 8, %g2
@@ -151,5 +149,4 @@ ENTRY(__memset)
 0:     retl
         nop
 END(__memset)
-
-weak_alias (__bzero, bzero)
+strong_alias(__memset,memset)
index 97a5dce..26d2fec 100644 (file)
@@ -65,9 +65,6 @@
 1:     retl
         add            %o0, -1, %o0
 
-.globl stpcpy
-.set stpcpy,__stpcpy
-.hidden __stpcpy
 ENTRY(__stpcpy)
        andcc           %o1, 3, %g0
        bne             10b
@@ -160,3 +157,5 @@ ENTRY(__stpcpy)
 19:    retl
         nop
 END(__stpcpy)
+
+strong_alias(__stpcpy,stpcpy)
index 8efe6ae..2ee630b 100644 (file)
@@ -91,9 +91,6 @@
        b               3f
         sub            %o0, 1, %o0
 
-.globl strcat
-.set strcat,__strcat
-.hidden __strcat
 ENTRY(__strcat)
        mov             %o0, %g2
        andcc           %o0, 3, %g0
@@ -347,3 +344,5 @@ ENTRY(__strcat)
        retl
         mov            %g2, %o0
 END(__strcat)
+
+strong_alias(__strcat,strcat)
index 450b4ff..69360c5 100644 (file)
@@ -67,9 +67,6 @@
 1:     retl
         sub            %o0, 1, %o0
 
-.globl strchr
-.set strchr,__strchr
-.hidden __strchr
 ENTRY(__strchr)
        andcc           %o1, 0xff, %o1
        be              12f
@@ -219,10 +216,9 @@ ENTRY(__strchr)
        b               7f
         ld             [%o0], %g4
 END(__strchr)
+strong_alias(__strchr,strchr)
+strong_alias(__strchr,index)
 
-.globl strrchr
-.set strrchr,__strrchr
-.hidden __strrchr
 ENTRY(__strrchr)
        andcc           %o1, 0xff, %o1
        clr             %o5
@@ -281,6 +277,5 @@ ENTRY(__strrchr)
 9:     retl
         mov            %o5, %o0
 END(__strrchr)
-
-weak_alias (strchr, index)
-weak_alias (strrchr, rindex)
+strong_alias(__strrchr,strrchr)
+strong_alias(__strrchr,rindex)
index 2ae1b2e..6a807e0 100644 (file)
@@ -74,9 +74,6 @@
 2:     retl
         mov            %o4, %o0
 
-.globl strcmp
-.set strcmp,__strcmp
-.hidden __strcmp
 ENTRY(__strcmp)
        andcc           %o0, 3, %g0
        bne             10b
@@ -256,3 +253,5 @@ ENTRY(__strcmp)
        jmpl            %i7 + 8, %g0
         restore        %g4, %g0, %o0
 END(__strcmp)
+
+strong_alias(__strcmp,strcmp)
index 6dc3517..ab57e00 100644 (file)
@@ -63,9 +63,6 @@
        b               6f
         andcc          %o0, 3, %g3
 
-.globl strcpy
-.set strcpy,__strcpy
-.hidden __strcpy
 ENTRY(__strcpy)
        mov             %o0, %g2
        andcc           %o1, 3, %g0
@@ -273,3 +270,5 @@ ENTRY(__strcpy)
        retl
         mov            %g2, %o0
 END(__strcpy)
+
+strong_alias(__strcpy,strcpy)
index 116700e..81beb7f 100644 (file)
@@ -63,9 +63,6 @@
 3:     retl
         mov            2, %o0
 
-.globl strlen
-.set strlen,__strlen
-.hidden __strlen
 ENTRY(__strlen)
        mov             %o0, %o1
        andcc           %o0, 3, %g0
@@ -102,3 +99,5 @@ ENTRY(__strlen)
 13:    retl
         sub            %o4, %o1, %o0
 END(__strlen)
+
+strong_alias(__strlen,strlen)
index a10dfbc..7017b55 100644 (file)
@@ -255,7 +255,7 @@ ENTRY(__memchr)
         add            %o0, -1, %o0                    /* IEU0                         */
 END(__memchr)
 
-weak_alias (__memchr, memchr)
+strong_alias(__memchr,memchr)
 #if !__BOUNDED_POINTERS__
-weak_alias (__memchr, __ubp_memchr)
+weak_alias(__memchr,__ubp_memchr)
 #endif
index 47f812a..4201b5e 100644 (file)
        .text
        .align          32
 
-.globl bcopy
-.set bcopy,__bcopy
-.hidden __bcopy
 ENTRY(__bcopy)
        sub             %o1, %o0, %o4                   /* IEU0         Group           */
        mov             %o0, %g3                        /* IEU1                         */
@@ -209,6 +206,7 @@ ENTRY(__bcopy)
        retl
         nop
 END(__bcopy)
+strong_alias(__bcopy,bcopy)
 
        .align          32
 200:   be,pt           %xcc, 201f                      /* CTI                          */
@@ -506,9 +504,6 @@ END(__align_cpy_16)
 #endif
 
        .align          32
-.globl memcpy
-.set memcpy,__memcpy
-.hidden __memcpy
 ENTRY(__memcpy)
 210:
 #ifndef USE_BPR
@@ -701,6 +696,7 @@ ENTRY(__memcpy)
        retl
         mov            %g4, %o0
 END(__memcpy)
+strong_alias(__memcpy,memcpy)
 
        .align          32
 228:   andcc           %o2, 1, %g0                     /* IEU1         Group           */
@@ -725,9 +721,6 @@ END(__memcpy)
         nop
 
        .align          32
-.globl memmove
-.set memmove,__memmove
-.hidden __memmove
 ENTRY(__memmove)
 #ifndef USE_BPR
        srl             %o2, 0, %o2                     /* IEU1         Group           */
@@ -920,8 +913,9 @@ ENTRY(__memmove)
        retl
         mov            %g4, %o0
 END(__memmove)
+strong_alias(__memmove,memmove)
 
 #ifdef USE_BPR
-weak_alias (memcpy, __align_cpy_1)
-weak_alias (memcpy, __align_cpy_2)
+weak_alias(__memcpy,__align_cpy_1)
+weak_alias(__memcpy,__align_cpy_2)
 #endif
index 5d29114..6fb25d2 100644 (file)
@@ -36,9 +36,6 @@
        /* Well, memset is a lot easier to get right than bcopy... */
        .text
        .align          32
-.globl memset
-.set memset,__memset
-.hidden __memset
 ENTRY(__memset)
        andcc           %o1, 0xff, %o1
        mov             %o0, %o5
@@ -180,6 +177,7 @@ ENTRY(__memset)
        ba,pt           %xcc, 18b
         ldd            [%o0], %f0
 END(__memset)
+strong_alias(__memset,memset)
 
 #define ZERO_BLOCKS(base, offset, source)              \
        stx             source, [base - offset - 0x38]; \
@@ -312,5 +310,4 @@ ENTRY(__bzero)
 0:     retl
         mov            %o5, %o0
 END(__bzero)
-
-weak_alias (__bzero, bzero)
+strong_alias(__bzero,bzero)
index 91e74d4..dd381c7 100644 (file)
@@ -36,9 +36,6 @@
        .text
        .align  32
 
-.globl bcopy
-.set bcopy,__bcopy
-.hidden __bcopy
 ENTRY(__bcopy)
        sub             %o1, %o0, %o4
        mov             %o0, %g4
@@ -54,6 +51,7 @@ ENTRY(__bcopy)
        retl
         nop
 END(__bcopy)
+strong_alias(__bcopy,bcopy)
 
        /* Special/non-trivial issues of this code:
         *
@@ -70,9 +68,6 @@ END(__bcopy)
         * of up to 2.4GB per second.
         */
        .align          32
-.globl memcpy
-.set memcpy,__memcpy
-.hidden __memcpy
 ENTRY(__memcpy)
 
 100: /* %o0=dst, %o1=src, %o2=len */
@@ -335,6 +330,7 @@ small_copy_unaligned:
         mov            %g5, %o0
 
 END(__memcpy)
+strong_alias(__memcpy,memcpy)
 
 #define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3)       \
        ldx             [%src - offset - 0x20], %t0;            \
@@ -409,9 +405,6 @@ END(__memcpy)
         mov            %g4, %o0
 
        .align          32
-.globl memmove
-.set memmove,__memmove
-.hidden __memmove
 ENTRY(__memmove)
        mov             %o0, %g5
 #ifndef USE_BPR
@@ -605,11 +598,12 @@ ENTRY(__memmove)
        retl
         mov            %g4, %o0
 END(__memmove)
+strong_alias(__memmove,memmove)
 
 #ifdef USE_BPR
-weak_alias (memcpy, __align_cpy_1)
-weak_alias (memcpy, __align_cpy_2)
-weak_alias (memcpy, __align_cpy_4)
-weak_alias (memcpy, __align_cpy_8)
-weak_alias (memcpy, __align_cpy_16)
+weak_alias(memcpy,__align_cpy_1)
+weak_alias(memcpy,__align_cpy_2)
+weak_alias(memcpy,__align_cpy_4)
+weak_alias(memcpy,__align_cpy_8)
+weak_alias(memcpy,__align_cpy_16)
 #endif
index a66f9d1..6bd24cf 100644 (file)
@@ -269,4 +269,4 @@ ENTRY(__stpcpy)
         mov            %g6, %o0                        /* IEU0                         */
 END(__stpcpy)
 
-weak_alias (__stpcpy, stpcpy)
+strong_alias(__stpcpy,stpcpy)
index 3b81e59..fb3ad2d 100644 (file)
@@ -47,9 +47,6 @@
 
        .text
        .align          32
-.globl strcat
-.set strcat,__strcat
-.hidden __strcat
 ENTRY(__strcat)
        sethi           %hi(0x01010101), %g1            /* IEU0         Group           */
        ldub            [%o0], %o3                      /* Load                         */
@@ -339,3 +336,5 @@ ENTRY(__strcat)
        retl                                            /* CTI+IEU1     Group           */
         mov            %g6, %o0                        /* IEU0                         */
 END(__strcat)
+
+strong_alias(__strcat,strcat)
index 6943e8b..34c30df 100644 (file)
@@ -47,9 +47,6 @@
 
        .text
        .align          32
-.globl strchr
-.set strchr,__strchr
-.hidden __strchr
 ENTRY(__strchr)
        andcc           %o1, 0xff, %o1                  /* IEU1         Group           */
        be,pn           %icc, 17f                       /* CTI                          */
@@ -331,11 +328,10 @@ ENTRY(__strchr)
        retl                                            /* CTI+IEU1     Group           */
         add            %o0, -1, %o0                    /* IEU0                         */
 END(__strchr)
+strong_alias(__strchr,strchr)
+strong_alias(__strchr,index)
 
        .align          32
-.globl strrchr
-.set strrchr,__strrchr
-.hidden __strrchr
 ENTRY(__strrchr)
        andcc           %o1, 0xff, %o1                  /* IEU1         Group           */
        be,pn           %icc, 17b                       /* CTI                          */
@@ -481,6 +477,5 @@ ENTRY(__strrchr)
 
         ldx            [%o0], %o3                      /* Load                         */
 END(__strrchr)
-
-weak_alias (strchr, index)
-weak_alias (strrchr, rindex)
+strong_alias(__strrchr,strrchr)
+strong_alias(__strrchr,rindex)
index a4eb366..0e078e9 100644 (file)
@@ -45,9 +45,6 @@
 
        .text
        .align          32
-.globl strcmp
-.set strcmp,__strcmp
-.hidden __strcmp
 ENTRY(__strcmp)
        sethi           %hi(0x01010101), %g1                    /* IEU0         Group           */
        andcc           %o0, 7, %g0                             /* IEU1                         */
@@ -279,3 +276,5 @@ ENTRY(__strcmp)
        ba,pt           %xcc, 11b                               /* CTI          Group           */
         ldxa           [%o1 + %o0] ASI_PNF, %g6                /* Load                         */
 END(__strcmp)
+
+strong_alias(__strcmp,strcmp)
index cc906ba..d9dff10 100644 (file)
@@ -45,9 +45,6 @@
 
        .text
        .align          32
-.globl strcpy
-.set strcpy,__strcpy
-.hidden __strcpy
 ENTRY(__strcpy)
        sethi           %hi(0x01010101), %g1            /* IEU0         Group           */
        mov             %o0, %g6                        /* IEU1                         */
@@ -244,3 +241,5 @@ ENTRY(__strcpy)
        retl                                            /* CTI+IEU1     Group           */
         mov            %g6, %o0                        /* IEU0                         */
 END(__strcpy)
+
+strong_alias(__strcpy,strcpy)
index 9f48fe6..3c1cfc0 100644 (file)
@@ -39,9 +39,6 @@
 
        .text
        .align          32
-.globl strlen
-.set strlen,__strlen
-.hidden __strlen
 ENTRY(__strlen)
        sethi           %hi(0x01010101), %g1            /* IEU0         Group           */
        ldub            [%o0], %o3                      /* Load                         */
@@ -173,3 +170,5 @@ ENTRY(__strlen)
        retl                                            /* CTI+IEU1     Group           */
         sub            %o0, %o1, %o0                   /* IEU0                         */
 END(__strlen)
+
+strong_alias(__strlen,strlen)
index f14b23c..3c31957 100644 (file)
@@ -14,6 +14,7 @@
 
 #define ENTRY(sym) \
        .global sym; \
+       .hidden sym; \
        .align  ENTRY_ALIGN; \
        .type   sym,%function; \
        sym:
@@ -26,8 +27,3 @@
 
 #define END(sym) \
        .size sym,.-sym;
-
-#undef weak_alias
-#define weak_alias(sym, alias) \
-       .weak alias; \
-    alias = sym;
index abd252e..73ba754 100644 (file)
@@ -1,3 +1,3 @@
-#define memset __bzero
+#define __memset __bzero
 #include "memset.S"
-weak_alias (__bzero, bzero)
+strong_alias(__bzero,bzero)
index c375bf3..973cd51 100644 (file)
@@ -23,7 +23,7 @@
 /* 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 MEMPCPY_P (defined __memcpy)
 
         .text
 #if defined PIC && !defined NOT_IN_libc
@@ -32,9 +32,6 @@ ENTRY (__memcpy_chk)
        jb      HIDDEN_JUMPTARGET (__chk_fail)
 END (__memcpy_chk)
 #endif
-.global memcpy
-.set memcpy,__memcpy
-.hidden __memcpy
 ENTRY (BP_SYM (__memcpy))
        /* Cutoff for the big loop is a size of 32 bytes since otherwise
           the loop will never be entered.  */
@@ -96,3 +93,6 @@ ENTRY (BP_SYM (__memcpy))
        ret
 
 END (BP_SYM (__memcpy))
+#if !MEMPCPY_P
+strong_alias(__memcpy,memcpy)
+#endif
diff --git a/libc/string/x86_64/mempcpy.S b/libc/string/x86_64/mempcpy.S
new file mode 100644 (file)
index 0000000..3a8e925
--- /dev/null
@@ -0,0 +1,3 @@
+#define __memcpy __mempcpy
+#include "memcpy.S"
+strong_alias(__mempcpy,mempcpy)
index d661955..923e1c2 100644 (file)
@@ -22,7 +22,7 @@
 #include "_glibc_inc.h"
 
 /* BEWARE: `#ifdef memset' means that memset is redefined as `bzero' */
-#define BZERO_P (defined memset)
+#define BZERO_P (defined __memset)
 
 /* This is somehow experimental and could made dependend on the cache
    size.  */
@@ -35,9 +35,6 @@ ENTRY (__memset_chk)
        jb      HIDDEN_JUMPTARGET (__chk_fail)
 END (__memset_chk)
 #endif
-.global memset
-.set memset,__memset
-.hidden __memset
 ENTRY (__memset)
 #if BZERO_P
        mov     %rsi,%rdx       /* Adjust parameter.  */
@@ -135,6 +132,9 @@ ENTRY (__memset)
        jmp     4b
 
 END (__memset)
+#if !BZERO_P
+strong_alias(__memset,memset)
+#endif
 
 #if !BZERO_P && defined PIC && !defined NOT_IN_libc
 strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
index 83294e1..0757733 100644 (file)
@@ -1,6 +1,4 @@
 #define USE_AS_STPCPY
 #define STRCPY __stpcpy
-
 #include "strcpy.S"
-
-weak_alias (__stpcpy, stpcpy)
+strong_alias(__stpcpy,stpcpy)
index 9ee10b2..6c7189a 100644 (file)
@@ -23,9 +23,6 @@
 
 
        .text
-.global strcat
-.set strcat,__strcat
-.hidden __strcat
 ENTRY (BP_SYM (__strcat))
        movq %rdi, %rcx         /* Dest. register. */
        andl $7, %ecx           /* mask alignment bits */
@@ -257,3 +254,5 @@ ENTRY (BP_SYM (__strcat))
        movq    %rdi, %rax      /* Source is return value.  */
        retq
 END (BP_SYM (__strcat))
+
+strong_alias(__strcat,strcat)
index 04d365a..312d62b 100644 (file)
@@ -22,9 +22,6 @@
 
 
        .text
-.globl strchr
-.set strchr,__strchr
-.hidden __strchr
 ENTRY (BP_SYM (__strchr))
 
        /* Before we start with the main loop we process single bytes
@@ -287,4 +284,5 @@ ENTRY (BP_SYM (__strchr))
        retq
 END (BP_SYM (__strchr))
 
-weak_alias (BP_SYM (strchr), BP_SYM (index))
+strong_alias(__strchr,strchr)
+strong_alias (BP_SYM (__strchr), BP_SYM (index))
index f933c11..1eaff16 100644 (file)
@@ -22,9 +22,6 @@
 #include "_glibc_inc.h"
 
         .text
-.global strcmp
-.set strcmp,__strcmp
-.hidden __strcmp
 ENTRY (BP_SYM (__strcmp))
 L(oop):        movb    (%rdi), %al
        cmpb    (%rsi), %al
@@ -42,3 +39,5 @@ L(neq):       movl    $1, %eax
        cmovbl  %ecx, %eax
        ret
 END (BP_SYM (__strcmp))
+
+strong_alias(__strcmp,strcmp)
index 1a64d27..0bd2a64 100644 (file)
@@ -22,9 +22,6 @@
 
 #ifndef USE_AS_STPCPY
 # define STRCPY __strcpy
-.global strcpy
-.set strcpy,__strcpy
-.hidden __strcpy
 #endif
 
        .text
@@ -154,3 +151,6 @@ ENTRY (BP_SYM (STRCPY))
 #endif
        retq
 END (BP_SYM (STRCPY))
+#ifndef USE_AS_STPCPY
+strong_alias(__strcpy,strcpy)
+#endif
index e25100b..35959e5 100644 (file)
 #define STRPBRK_P (defined __strcspn)
 
        .text
-#if STRPBRK_P
-#else
-.global strcspn
-.set strcspn,__strcspn
-.hidden __strcspn
-#endif
 ENTRY (__strcspn)
 
        movq %rdi, %rdx         /* Save SRC.  */
@@ -127,3 +121,7 @@ L(4):       addq $256, %rsp         /* remove skipset */
 #endif
        ret
 END (__strcspn)
+
+#if !STRPBRK_P
+strong_alias(__strcspn,strcspn)
+#endif
index ab25515..77aae71 100644 (file)
@@ -22,9 +22,6 @@
 
 
        .text
-.global strlen
-.set strlen,__strlen
-.hidden __strlen
 ENTRY (__strlen)
        movq %rdi, %rcx         /* Duplicate source pointer. */
        andl $7, %ecx           /* mask alignment bits */
@@ -136,3 +133,5 @@ ENTRY (__strlen)
        subq %rdi, %rax         /* compute difference to string start */
        ret
 END (__strlen)
+
+strong_alias(__strlen,strlen)
index c37befe..94b14d0 100644 (file)
@@ -1,5 +1,3 @@
 #define __strcspn __strpbrk
-.global strpbrk
-.set strpbrk,__strpbrk
-.hidden __strpbrk
 #include "strcspn.S"
+strong_alias(__strpbrk,strpbrk)
index 8d5903c..ae5b4a1 100644 (file)
@@ -26,9 +26,6 @@
 #include "_glibc_inc.h"
 
        .text
-.global strspn
-.set strspn,__strspn
-.hidden __strspn
 ENTRY (__strspn)
 
        movq %rdi, %rdx         /* Save SRC.  */
@@ -115,3 +112,5 @@ L(4):       addq $256, %rsp         /* remove stopset */
                                   non-valid character */
        ret
 END (__strspn)
+
+strong_alias(__strspn,strspn)