Browse Source

Use strong_alias everywhere instead of .global/.set. Correct some cases where the non-hidden version was used.

Peter S. Mazinger 18 years ago
parent
commit
fe68563b9a
95 changed files with 213 additions and 326 deletions
  1. 1 0
      libc/string/arm/_memcpy.S
  2. 4 2
      libc/string/arm/bcopy.S
  3. 5 2
      libc/string/arm/bzero.S
  4. 4 3
      libc/string/arm/memcmp.S
  5. 5 3
      libc/string/arm/memcpy.S
  6. 5 3
      libc/string/arm/memmove.S
  7. 3 2
      libc/string/arm/memset.S
  8. 4 4
      libc/string/arm/strcmp.S
  9. 3 2
      libc/string/arm/strlen.S
  10. 4 2
      libc/string/arm/strncmp.S
  11. 3 2
      libc/string/frv/memcpy.S
  12. 3 2
      libc/string/frv/memset.S
  13. 1 3
      libc/string/generic/memchr.c
  14. 2 4
      libc/string/generic/memcmp.c
  15. 1 3
      libc/string/generic/memcpy.c
  16. 1 3
      libc/string/generic/memmem.c
  17. 1 3
      libc/string/generic/memmove.c
  18. 0 2
      libc/string/generic/mempcpy.c
  19. 1 3
      libc/string/generic/memrchr.c
  20. 1 3
      libc/string/generic/memset.c
  21. 1 3
      libc/string/generic/rawmemchr.c
  22. 1 3
      libc/string/generic/strcat.c
  23. 2 4
      libc/string/generic/strchr.c
  24. 1 3
      libc/string/generic/strchrnul.c
  25. 5 8
      libc/string/generic/strcmp.c
  26. 1 3
      libc/string/generic/strcpy.c
  27. 1 3
      libc/string/generic/strcspn.c
  28. 1 3
      libc/string/generic/strlen.c
  29. 1 3
      libc/string/generic/strncat.c
  30. 1 3
      libc/string/generic/strncmp.c
  31. 1 3
      libc/string/generic/strncpy.c
  32. 1 3
      libc/string/generic/strnlen.c
  33. 2 4
      libc/string/generic/strrchr.c
  34. 1 3
      libc/string/generic/strsep.c
  35. 1 3
      libc/string/generic/strspn.c
  36. 1 3
      libc/string/generic/strstr.c
  37. 4 10
      libc/string/generic/strtok_r.c
  38. 1 2
      libc/string/i386/memchr.c
  39. 1 2
      libc/string/i386/memcpy.c
  40. 1 2
      libc/string/i386/memmove.c
  41. 1 2
      libc/string/i386/memset.c
  42. 1 2
      libc/string/i386/strcat.c
  43. 2 3
      libc/string/i386/strchr.c
  44. 5 7
      libc/string/i386/strcmp.c
  45. 1 2
      libc/string/i386/strcpy.c
  46. 1 2
      libc/string/i386/strlen.c
  47. 1 2
      libc/string/i386/strncat.c
  48. 1 2
      libc/string/i386/strncmp.c
  49. 1 2
      libc/string/i386/strncpy.c
  50. 1 2
      libc/string/i386/strnlen.c
  51. 2 3
      libc/string/i386/strrchr.c
  52. 5 3
      libc/string/mips/memcpy.S
  53. 5 3
      libc/string/mips/memset.S
  54. 1 6
      libc/string/mips/sysdep.h
  55. 1 2
      libc/string/powerpc/memcpy.c
  56. 1 2
      libc/string/powerpc/memmove.c
  57. 1 2
      libc/string/powerpc/memset.c
  58. 5 3
      libc/string/sh64/memcpy.S
  59. 3 2
      libc/string/sh64/memset.S
  60. 4 3
      libc/string/sh64/strcpy.S
  61. 4 2
      libc/string/sh64/strlen.S
  62. 1 5
      libc/string/sparc/_glibc_inc.h
  63. 2 4
      libc/string/sparc/sparc32/memchr.S
  64. 3 9
      libc/string/sparc/sparc32/memcpy.S
  65. 2 5
      libc/string/sparc/sparc32/memset.S
  66. 2 3
      libc/string/sparc/sparc32/stpcpy.S
  67. 2 3
      libc/string/sparc/sparc32/strcat.S
  68. 4 9
      libc/string/sparc/sparc32/strchr.S
  69. 2 3
      libc/string/sparc/sparc32/strcmp.S
  70. 2 3
      libc/string/sparc/sparc32/strcpy.S
  71. 2 3
      libc/string/sparc/sparc32/strlen.S
  72. 2 2
      libc/string/sparc/sparc64/memchr.S
  73. 5 11
      libc/string/sparc/sparc64/memcpy.S
  74. 2 5
      libc/string/sparc/sparc64/memset.S
  75. 8 14
      libc/string/sparc/sparc64/sparcv9b/memcpy.S
  76. 1 1
      libc/string/sparc/sparc64/stpcpy.S
  77. 2 3
      libc/string/sparc/sparc64/strcat.S
  78. 4 9
      libc/string/sparc/sparc64/strchr.S
  79. 2 3
      libc/string/sparc/sparc64/strcmp.S
  80. 2 3
      libc/string/sparc/sparc64/strcpy.S
  81. 2 3
      libc/string/sparc/sparc64/strlen.S
  82. 1 5
      libc/string/x86_64/_glibc_inc.h
  83. 2 2
      libc/string/x86_64/bzero.S
  84. 4 4
      libc/string/x86_64/memcpy.S
  85. 3 0
      libc/string/x86_64/mempcpy.S
  86. 4 4
      libc/string/x86_64/memset.S
  87. 1 3
      libc/string/x86_64/stpcpy.S
  88. 2 3
      libc/string/x86_64/strcat.S
  89. 2 4
      libc/string/x86_64/strchr.S
  90. 2 3
      libc/string/x86_64/strcmp.S
  91. 3 3
      libc/string/x86_64/strcpy.S
  92. 4 6
      libc/string/x86_64/strcspn.S
  93. 2 3
      libc/string/x86_64/strlen.S
  94. 1 3
      libc/string/x86_64/strpbrk.S
  95. 2 3
      libc/string/x86_64/strspn.S

+ 1 - 0
libc/string/arm/_memcpy.S

@@ -73,6 +73,7 @@
 
 .text
 .global _memcpy
+.hidden _memcpy
 .type _memcpy,%function
 .align 4
 

+ 4 - 2
libc/string/arm/bcopy.S

@@ -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)

+ 5 - 2
libc/string/arm/bzero.S

@@ -37,16 +37,19 @@
  * 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)

+ 4 - 3
libc/string/arm/memcmp.S

@@ -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)

+ 5 - 3
libc/string/arm/memcpy.S

@@ -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)

+ 5 - 3
libc/string/arm/memmove.S

@@ -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)

+ 3 - 2
libc/string/arm/memset.S

@@ -17,10 +17,9 @@
    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)

+ 4 - 4
libc/string/arm/strcmp.S

@@ -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

+ 3 - 2
libc/string/arm/strlen.S

@@ -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)

+ 4 - 2
libc/string/arm/strncmp.S

@@ -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)

+ 3 - 2
libc/string/frv/memcpy.S

@@ -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)

+ 3 - 2
libc/string/frv/memset.S

@@ -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)

+ 1 - 3
libc/string/generic/memchr.c

@@ -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)

+ 2 - 4
libc/string/generic/memcmp.c

@@ -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)

+ 1 - 3
libc/string/generic/memcpy.c

@@ -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)

+ 1 - 3
libc/string/generic/memmem.c

@@ -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)

+ 1 - 3
libc/string/generic/memmove.c

@@ -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)

+ 0 - 2
libc/string/generic/mempcpy.c

@@ -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);

+ 1 - 3
libc/string/generic/memrchr.c

@@ -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)

+ 1 - 3
libc/string/generic/memset.c

@@ -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)

+ 1 - 3
libc/string/generic/rawmemchr.c

@@ -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)

+ 1 - 3
libc/string/generic/strcat.c

@@ -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)

+ 2 - 4
libc/string/generic/strchr.c

@@ -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)

+ 1 - 3
libc/string/generic/strchrnul.c

@@ -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)

+ 5 - 8
libc/string/generic/strcmp.c

@@ -17,12 +17,9 @@
    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

+ 1 - 3
libc/string/generic/strcpy.c

@@ -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)

+ 1 - 3
libc/string/generic/strcspn.c

@@ -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)

+ 1 - 3
libc/string/generic/strlen.c

@@ -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)

+ 1 - 3
libc/string/generic/strncat.c

@@ -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)

+ 1 - 3
libc/string/generic/strncmp.c

@@ -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)

+ 1 - 3
libc/string/generic/strncpy.c

@@ -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)

+ 1 - 3
libc/string/generic/strnlen.c

@@ -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)

+ 2 - 4
libc/string/generic/strrchr.c

@@ -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)

+ 1 - 3
libc/string/generic/strsep.c

@@ -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)

+ 1 - 3
libc/string/generic/strspn.c

@@ -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)

+ 1 - 3
libc/string/generic/strstr.c

@@ -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)

+ 4 - 10
libc/string/generic/strtok_r.c

@@ -17,15 +17,9 @@
    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)

+ 1 - 2
libc/string/i386/memchr.c

@@ -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)

+ 1 - 2
libc/string/i386/memcpy.c

@@ -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)

+ 1 - 2
libc/string/i386/memmove.c

@@ -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)

+ 1 - 2
libc/string/i386/memset.c

@@ -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)

+ 1 - 2
libc/string/i386/strcat.c

@@ -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)

+ 2 - 3
libc/string/i386/strchr.c

@@ -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)

+ 5 - 7
libc/string/i386/strcmp.c

@@ -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

+ 1 - 2
libc/string/i386/strcpy.c

@@ -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)

+ 1 - 2
libc/string/i386/strlen.c

@@ -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)

+ 1 - 2
libc/string/i386/strncat.c

@@ -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)

+ 1 - 2
libc/string/i386/strncmp.c

@@ -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)

+ 1 - 2
libc/string/i386/strncpy.c

@@ -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)

+ 1 - 2
libc/string/i386/strnlen.c

@@ -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)

+ 2 - 3
libc/string/i386/strrchr.c

@@ -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)

+ 5 - 3
libc/string/mips/memcpy.S

@@ -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)

+ 5 - 3
libc/string/mips/memset.S

@@ -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)

+ 1 - 6
libc/string/mips/sysdep.h

@@ -27,6 +27,7 @@
 
 #define ENTRY(name) \
   .globl name;                                                                \
+  .hidden name;                                                               \
   .align 2;                                                                   \
   .ent name,0;                                                                \
   name##:
@@ -42,10 +43,4 @@
 # 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

+ 1 - 2
libc/string/powerpc/memcpy.c

@@ -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)

+ 1 - 2
libc/string/powerpc/memmove.c

@@ -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)

+ 1 - 2
libc/string/powerpc/memset.c

@@ -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)

+ 5 - 3
libc/string/sh64/memcpy.S

@@ -36,14 +36,14 @@
 !     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)

+ 3 - 2
libc/string/sh64/memset.S

@@ -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)

+ 4 - 3
libc/string/sh64/strcpy.S

@@ -6,6 +6,7 @@
 !
 ! SH5 code Copyright 2002 SuperH Ltd.
 
+#include <features.h>
 #include <endian.h>
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -17,13 +18,11 @@
 #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)

+ 4 - 2
libc/string/sh64/strlen.S

@@ -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)

+ 1 - 5
libc/string/sparc/_glibc_inc.h

@@ -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;

+ 2 - 4
libc/string/sparc/sparc32/memchr.S

@@ -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

+ 3 - 9
libc/string/sparc/sparc32/memcpy.S

@@ -161,18 +161,13 @@
 	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)

+ 2 - 5
libc/string/sparc/sparc32/memset.S

@@ -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)

+ 2 - 3
libc/string/sparc/sparc32/stpcpy.S

@@ -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)

+ 2 - 3
libc/string/sparc/sparc32/strcat.S

@@ -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)

+ 4 - 9
libc/string/sparc/sparc32/strchr.S

@@ -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)

+ 2 - 3
libc/string/sparc/sparc32/strcmp.S

@@ -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)

+ 2 - 3
libc/string/sparc/sparc32/strcpy.S

@@ -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)

+ 2 - 3
libc/string/sparc/sparc32/strlen.S

@@ -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)

+ 2 - 2
libc/string/sparc/sparc64/memchr.S

@@ -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

+ 5 - 11
libc/string/sparc/sparc64/memcpy.S

@@ -191,9 +191,6 @@
 	.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

+ 2 - 5
libc/string/sparc/sparc64/memset.S

@@ -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)

+ 8 - 14
libc/string/sparc/sparc64/sparcv9b/memcpy.S

@@ -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

+ 1 - 1
libc/string/sparc/sparc64/stpcpy.S

@@ -269,4 +269,4 @@ ENTRY(__stpcpy)
 	 mov		%g6, %o0			/* IEU0				*/
 END(__stpcpy)
 
-weak_alias (__stpcpy, stpcpy)
+strong_alias(__stpcpy,stpcpy)

+ 2 - 3
libc/string/sparc/sparc64/strcat.S

@@ -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)

+ 4 - 9
libc/string/sparc/sparc64/strchr.S

@@ -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)

+ 2 - 3
libc/string/sparc/sparc64/strcmp.S

@@ -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)

+ 2 - 3
libc/string/sparc/sparc64/strcpy.S

@@ -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)

+ 2 - 3
libc/string/sparc/sparc64/strlen.S

@@ -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)

+ 1 - 5
libc/string/x86_64/_glibc_inc.h

@@ -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;

+ 2 - 2
libc/string/x86_64/bzero.S

@@ -1,3 +1,3 @@
-#define memset __bzero
+#define __memset __bzero
 #include "memset.S"
-weak_alias (__bzero, bzero)
+strong_alias(__bzero,bzero)

+ 4 - 4
libc/string/x86_64/memcpy.S

@@ -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

+ 3 - 0
libc/string/x86_64/mempcpy.S

@@ -0,0 +1,3 @@
+#define __memcpy __mempcpy
+#include "memcpy.S"
+strong_alias(__mempcpy,mempcpy)

+ 4 - 4
libc/string/x86_64/memset.S

@@ -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)

+ 1 - 3
libc/string/x86_64/stpcpy.S

@@ -1,6 +1,4 @@
 #define USE_AS_STPCPY
 #define STRCPY __stpcpy
-
 #include "strcpy.S"
-
-weak_alias (__stpcpy, stpcpy)
+strong_alias(__stpcpy,stpcpy)

+ 2 - 3
libc/string/x86_64/strcat.S

@@ -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)

+ 2 - 4
libc/string/x86_64/strchr.S

@@ -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))

+ 2 - 3
libc/string/x86_64/strcmp.S

@@ -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)

+ 3 - 3
libc/string/x86_64/strcpy.S

@@ -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

+ 4 - 6
libc/string/x86_64/strcspn.S

@@ -29,12 +29,6 @@
 #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

+ 2 - 3
libc/string/x86_64/strlen.S

@@ -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)

+ 1 - 3
libc/string/x86_64/strpbrk.S

@@ -1,5 +1,3 @@
 #define __strcspn __strpbrk
-.global strpbrk
-.set strpbrk,__strpbrk
-.hidden __strpbrk
 #include "strcspn.S"
+strong_alias(__strpbrk,strpbrk)

+ 2 - 3
libc/string/x86_64/strspn.S

@@ -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)