OSDN Git Service

mark a bunch of public mem/str functions as weak so that people who insist on their...
authorMike Frysinger <vapier@gentoo.org>
Sat, 22 Dec 2007 06:28:23 +0000 (06:28 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 22 Dec 2007 06:28:23 +0000 (06:28 -0000)
21 files changed:
libc/string/bfin/memchr.S
libc/string/bfin/memcmp.S
libc/string/bfin/memcpy.S
libc/string/bfin/memmove.S
libc/string/bfin/memset.S
libc/string/bfin/strcmp.S
libc/string/generic/memchr.c
libc/string/generic/memcmp.c
libc/string/generic/memcpy.c
libc/string/generic/memmove.c
libc/string/generic/mempcpy.c
libc/string/generic/memset.c
libc/string/generic/strchr.c
libc/string/generic/strcmp.c
libc/string/generic/strlen.c
libc/string/generic/strrchr.c
libc/string/mempcpy.c
libc/string/strchr.c
libc/string/strdup.c
libc/string/strlen.c
libc/string/strrchr.c

index c264ad3..88e46be 100644 (file)
@@ -23,6 +23,7 @@
 
 .align 2
 
+.weak _memchr
 ENTRY(_memchr)
        P0 = R0;             // P0 = address
        P2 = R2;             // P2 = count
index b5d4f1c..7cc76ad 100644 (file)
@@ -23,6 +23,7 @@
 
 .align 2
 
+.weak _memcmp
 ENTRY(_memcmp)
        I1 = P3;
        P0 = R0;                        /* P0 = s1 address */
@@ -99,5 +100,5 @@ ENTRY(_memcmp)
 libc_hidden_def (memcmp)
 
 #ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias (memcmp,bcmp)
+weak_alias (memcmp,bcmp)
 #endif
index ae40cb2..bdd7606 100644 (file)
 
 .align 2
 
-/* We have to bypass the libc-symbols.h machinery to make sure we get
- * a weak symbol for memcpy (some crummy gcc tests want to redefine it).
- */
-.global ___GI_memcpy
-.type ___GI_memcpy, STT_FUNC
-___GI_memcpy:
+.weak _memcpy
+ENTRY(_memcpy)
        [--SP] = P3;
        P0 = R0;              /* P0 = To address */
        P3 = R1;              /* P3 = From Address */
@@ -75,8 +71,7 @@ ___GI_memcpy:
        P3 = [SP++];
 
        RTS;
-.size ___GI_memcpy,.-___GI_memcpy
 
-.hidden ___GI_memcpy
-.weak _memcpy
-.set _memcpy,___GI_memcpy
+.size _memcpy,.-_memcpy
+
+libc_hidden_def (memcpy)
index da11283..73e3638 100644 (file)
 
 .align 2
 
-       /* We have to bypass the libc-symbols.h machinery to make sure we get
-          a weak symbol for memcpy (some crummy gcc tests want to redefine
-          it).  */
-.global ___GI_memmove
-.type ___GI_memmove, STT_FUNC
-___GI_memmove:
+.weak _memmove
+ENTRY(_memmove)
        I1 = P3;
        P0 = R0;                  /* P0 = To address */
        P3 = R1;                  /* P3 = From Address */
@@ -99,8 +95,6 @@ ___GI_memmove:
        P3 = I1;
        RTS;
 
-.size ___GI_memmove,.-___GI_memmove
+.size _memmove,.-_memmove
 
-.hidden ___GI_memmove
-.weak _memmove
-.set _memmove,___GI_memmove
+libc_hidden_def (memmove)
index c8ee083..64012f7 100644 (file)
 
 .align 2
 
-/* We have to bypass the libc-symbols.h machinery to make sure we get
- * a weak symbol for memcpy (some crummy gcc tests want to redefine it).
- */
-.global ___GI_memset
-.type ___GI_memset, STT_FUNC
-___GI_memset:
+.weak _memset
+ENTRY(_memset)
        P0 = R0 ;              /* P0 = address */
        P2 = R2 ;              /* P2 = count   */
        R3 = R0 + R2;          /* end          */
@@ -89,8 +85,6 @@ ___GI_memset:
        B[P0++] = R1;
        JUMP .Laligned;
 
-.size ___GI_memset,.-___GI_memset
+.size _memset,.-_memset
 
-.hidden ___GI_memset
-.weak _memset
-.set _memset,___GI_memset
+libc_hidden_def (memset)
index c0a706d..12e8c53 100644 (file)
@@ -23,6 +23,7 @@
 
 .align 2
 
+.weak _strcmp
 ENTRY(_strcmp)
        [--sp] = (R7:4);
        p1 = r0;
@@ -116,6 +117,6 @@ ENTRY(_strcmp)
 libc_hidden_def (strcmp)
 
 #ifndef __UCLIBC_HAS_LOCALE__
-strong_alias (strcmp,strcoll)
+weak_alias (strcmp,strcoll)
 libc_hidden_def (strcoll)
 #endif
index 4bda5d7..4b40e4d 100644 (file)
@@ -174,4 +174,4 @@ void *memchr (const void * s, int c_in, size_t n)
 
   return 0;
 }
-libc_hidden_def(memchr)
+libc_hidden_weak(memchr)
index b754a51..b0d05cf 100644 (file)
@@ -330,7 +330,7 @@ memcmp (const __ptr_t s1, const __ptr_t s2, size_t len)
 
   return 0;
 }
-libc_hidden_def(memcmp)
+libc_hidden_weak(memcmp)
 #ifdef __UCLIBC_SUSV3_LEGACY__
 strong_alias(memcmp,bcmp)
 #endif
index 42e97a0..9d87641 100644 (file)
@@ -244,4 +244,4 @@ void *memcpy (void *dstpp, const void *srcpp, size_t len)
 
   return dstpp;
 }
-libc_hidden_def(memcpy)
+libc_hidden_weak(memcpy)
index 68caacd..dca74ae 100644 (file)
@@ -279,4 +279,4 @@ void *memmove (void *dest, const void *src, size_t len)
 
   return (dest);
 }
-libc_hidden_def(memmove)
+libc_hidden_weak(memmove)
index 46d1902..c80caac 100644 (file)
@@ -16,5 +16,5 @@ void *mempcpy (void *dstpp, const void *srcpp, size_t len)
   memcpy(dstpp, srcpp, len);
   return (void *)(((char *)dstpp) + len);
 }
-libc_hidden_def(mempcpy)
+libc_hidden_weak(mempcpy)
 #endif
index 1df1a45..50803ca 100644 (file)
@@ -83,4 +83,4 @@ void *memset (void *dstpp, int c, size_t len)
 
   return dstpp;
 }
-libc_hidden_def(memset)
+libc_hidden_weak(memset)
index 8d401ec..985b78b 100644 (file)
@@ -181,7 +181,7 @@ char *strchr (const char *s, int c_in)
 
   return NULL;
 }
-libc_hidden_def(strchr)
+libc_hidden_weak(strchr)
 #ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strchr,index)
+weak_alias(strchr,index)
 #endif
index acfefb6..21c8969 100644 (file)
@@ -41,7 +41,7 @@ int strcmp (const char *p1, const char *p2)
 
   return c1 - c2;
 }
-libc_hidden_def(strcmp)
+libc_hidden_weak(strcmp)
 
 #ifndef __UCLIBC_HAS_LOCALE__
 libc_hidden_proto(strcoll)
index 3528829..7e9b12f 100644 (file)
@@ -149,4 +149,4 @@ size_t strlen (const char *str)
        }
     }
 }
-libc_hidden_def(strlen)
+libc_hidden_weak(strlen)
index 97192da..fe7118a 100644 (file)
@@ -42,7 +42,7 @@ char *strrchr (const char *s, int c)
 
   return (char *) found;
 }
-libc_hidden_def(strrchr)
+libc_hidden_weak(strrchr)
 #ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strrchr,rindex)
+weak_alias(strrchr,rindex)
 #endif
index cf4af8d..9189643 100644 (file)
@@ -36,5 +36,5 @@ Wvoid *Wmempcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)
        return r1;
 }
 
-libc_hidden_def(Wmempcpy)
+libc_hidden_weak(Wmempcpy)
 #endif
index 0ce5524..329545e 100644 (file)
@@ -28,5 +28,5 @@ Wchar *Wstrchr(register const Wchar *s, Wint c)
 libc_hidden_def(Wstrchr)
 
 #if !defined WANT_WIDE && defined __UCLIBC_SUSV3_LEGACY__
-strong_alias(strchr,index)
+weak_alias(strchr,index)
 #endif
index d15345d..fff7444 100644 (file)
@@ -33,5 +33,5 @@ Wchar *Wstrdup(register const Wchar *s1)
 }
 
 #ifndef WANT_WIDE
-libc_hidden_def(strdup)
+libc_hidden_weak(strdup)
 #endif
index bcb096b..2edb6e4 100644 (file)
@@ -23,4 +23,4 @@ size_t Wstrlen(const Wchar *s)
 
        return p - s;
 }
-libc_hidden_def(Wstrlen)
+libc_hidden_weak(Wstrlen)
index 67cafb7..2bf676d 100644 (file)
@@ -28,8 +28,8 @@ Wchar *Wstrrchr(register const  Wchar *s, Wint c)
        return (Wchar *) p;                     /* silence the warning */
 }
 #ifndef WANT_WIDE
-libc_hidden_def(strrchr)
+libc_hidden_weak(strrchr)
 # ifdef __UCLIBC_SUSV3_LEGACY__
-strong_alias(strrchr,rindex)
+weak_alias(strrchr,rindex)
 # endif
 #endif