summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/string/arm/_memcpy.S1
-rw-r--r--libc/string/arm/bcopy.S6
-rw-r--r--libc/string/arm/bzero.S7
-rw-r--r--libc/string/arm/memcmp.S7
-rw-r--r--libc/string/arm/memcpy.S8
-rw-r--r--libc/string/arm/memmove.S8
-rw-r--r--libc/string/arm/memset.S5
-rw-r--r--libc/string/arm/strcmp.S8
-rw-r--r--libc/string/arm/strlen.S5
-rw-r--r--libc/string/arm/strncmp.S6
-rw-r--r--libc/string/frv/memcpy.S5
-rw-r--r--libc/string/frv/memset.S5
-rw-r--r--libc/string/generic/memchr.c4
-rw-r--r--libc/string/generic/memcmp.c6
-rw-r--r--libc/string/generic/memcpy.c4
-rw-r--r--libc/string/generic/memmem.c4
-rw-r--r--libc/string/generic/memmove.c4
-rw-r--r--libc/string/generic/mempcpy.c2
-rw-r--r--libc/string/generic/memrchr.c4
-rw-r--r--libc/string/generic/memset.c4
-rw-r--r--libc/string/generic/rawmemchr.c4
-rw-r--r--libc/string/generic/strcat.c4
-rw-r--r--libc/string/generic/strchr.c6
-rw-r--r--libc/string/generic/strchrnul.c4
-rw-r--r--libc/string/generic/strcmp.c13
-rw-r--r--libc/string/generic/strcpy.c4
-rw-r--r--libc/string/generic/strcspn.c4
-rw-r--r--libc/string/generic/strlen.c4
-rw-r--r--libc/string/generic/strncat.c4
-rw-r--r--libc/string/generic/strncmp.c4
-rw-r--r--libc/string/generic/strncpy.c4
-rw-r--r--libc/string/generic/strnlen.c4
-rw-r--r--libc/string/generic/strrchr.c6
-rw-r--r--libc/string/generic/strsep.c4
-rw-r--r--libc/string/generic/strspn.c4
-rw-r--r--libc/string/generic/strstr.c4
-rw-r--r--libc/string/generic/strtok_r.c14
-rw-r--r--libc/string/i386/memchr.c3
-rw-r--r--libc/string/i386/memcpy.c3
-rw-r--r--libc/string/i386/memmove.c3
-rw-r--r--libc/string/i386/memset.c3
-rw-r--r--libc/string/i386/strcat.c3
-rw-r--r--libc/string/i386/strchr.c5
-rw-r--r--libc/string/i386/strcmp.c12
-rw-r--r--libc/string/i386/strcpy.c3
-rw-r--r--libc/string/i386/strlen.c3
-rw-r--r--libc/string/i386/strncat.c3
-rw-r--r--libc/string/i386/strncmp.c3
-rw-r--r--libc/string/i386/strncpy.c3
-rw-r--r--libc/string/i386/strnlen.c3
-rw-r--r--libc/string/i386/strrchr.c5
-rw-r--r--libc/string/mips/memcpy.S8
-rw-r--r--libc/string/mips/memset.S8
-rw-r--r--libc/string/mips/sysdep.h7
-rw-r--r--libc/string/powerpc/memcpy.c3
-rw-r--r--libc/string/powerpc/memmove.c3
-rw-r--r--libc/string/powerpc/memset.c3
-rw-r--r--libc/string/sh64/memcpy.S8
-rw-r--r--libc/string/sh64/memset.S5
-rw-r--r--libc/string/sh64/strcpy.S7
-rw-r--r--libc/string/sh64/strlen.S6
-rw-r--r--libc/string/sparc/_glibc_inc.h6
-rw-r--r--libc/string/sparc/sparc32/memchr.S6
-rw-r--r--libc/string/sparc/sparc32/memcpy.S12
-rw-r--r--libc/string/sparc/sparc32/memset.S7
-rw-r--r--libc/string/sparc/sparc32/stpcpy.S5
-rw-r--r--libc/string/sparc/sparc32/strcat.S5
-rw-r--r--libc/string/sparc/sparc32/strchr.S13
-rw-r--r--libc/string/sparc/sparc32/strcmp.S5
-rw-r--r--libc/string/sparc/sparc32/strcpy.S5
-rw-r--r--libc/string/sparc/sparc32/strlen.S5
-rw-r--r--libc/string/sparc/sparc64/memchr.S4
-rw-r--r--libc/string/sparc/sparc64/memcpy.S16
-rw-r--r--libc/string/sparc/sparc64/memset.S7
-rw-r--r--libc/string/sparc/sparc64/sparcv9b/memcpy.S22
-rw-r--r--libc/string/sparc/sparc64/stpcpy.S2
-rw-r--r--libc/string/sparc/sparc64/strcat.S5
-rw-r--r--libc/string/sparc/sparc64/strchr.S13
-rw-r--r--libc/string/sparc/sparc64/strcmp.S5
-rw-r--r--libc/string/sparc/sparc64/strcpy.S5
-rw-r--r--libc/string/sparc/sparc64/strlen.S5
-rw-r--r--libc/string/x86_64/_glibc_inc.h6
-rw-r--r--libc/string/x86_64/bzero.S4
-rw-r--r--libc/string/x86_64/memcpy.S8
-rw-r--r--libc/string/x86_64/mempcpy.S3
-rw-r--r--libc/string/x86_64/memset.S8
-rw-r--r--libc/string/x86_64/stpcpy.S4
-rw-r--r--libc/string/x86_64/strcat.S5
-rw-r--r--libc/string/x86_64/strchr.S6
-rw-r--r--libc/string/x86_64/strcmp.S5
-rw-r--r--libc/string/x86_64/strcpy.S6
-rw-r--r--libc/string/x86_64/strcspn.S10
-rw-r--r--libc/string/x86_64/strlen.S5
-rw-r--r--libc/string/x86_64/strpbrk.S4
-rw-r--r--libc/string/x86_64/strspn.S5
95 files changed, 213 insertions, 326 deletions
diff --git a/libc/string/arm/_memcpy.S b/libc/string/arm/_memcpy.S
index 236500e5f..e8d78af23 100644
--- a/libc/string/arm/_memcpy.S
+++ b/libc/string/arm/_memcpy.S
@@ -73,6 +73,7 @@
.text
.global _memcpy
+.hidden _memcpy
.type _memcpy,%function
.align 4
diff --git a/libc/string/arm/bcopy.S b/libc/string/arm/bcopy.S
index a02807527..2914b8972 100644
--- a/libc/string/arm/bcopy.S
+++ b/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)
diff --git a/libc/string/arm/bzero.S b/libc/string/arm/bzero.S
index 93582f7c8..2cb67097e 100644
--- a/libc/string/arm/bzero.S
+++ b/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)
diff --git a/libc/string/arm/memcmp.S b/libc/string/arm/memcmp.S
index bdb5aca18..a97e02742 100644
--- a/libc/string/arm/memcmp.S
+++ b/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)
diff --git a/libc/string/arm/memcpy.S b/libc/string/arm/memcpy.S
index 372da4c49..8f81a15e5 100644
--- a/libc/string/arm/memcpy.S
+++ b/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)
diff --git a/libc/string/arm/memmove.S b/libc/string/arm/memmove.S
index eafd345b4..a26cf731e 100644
--- a/libc/string/arm/memmove.S
+++ b/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)
diff --git a/libc/string/arm/memset.S b/libc/string/arm/memset.S
index 5fca03a13..dea05a6b0 100644
--- a/libc/string/arm/memset.S
+++ b/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)
diff --git a/libc/string/arm/strcmp.S b/libc/string/arm/strcmp.S
index 33acc14cf..3f462dec0 100644
--- a/libc/string/arm/strcmp.S
+++ b/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
diff --git a/libc/string/arm/strlen.S b/libc/string/arm/strlen.S
index 7d91fd033..f623cbe20 100644
--- a/libc/string/arm/strlen.S
+++ b/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)
diff --git a/libc/string/arm/strncmp.S b/libc/string/arm/strncmp.S
index 94e93f7df..a3278727e 100644
--- a/libc/string/arm/strncmp.S
+++ b/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)
diff --git a/libc/string/frv/memcpy.S b/libc/string/frv/memcpy.S
index 1ffc7c398..abd8a28db 100644
--- a/libc/string/frv/memcpy.S
+++ b/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)
diff --git a/libc/string/frv/memset.S b/libc/string/frv/memset.S
index 62e705a44..a548b3779 100644
--- a/libc/string/frv/memset.S
+++ b/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)
diff --git a/libc/string/generic/memchr.c b/libc/string/generic/memchr.c
index bc0623f3f..68c820814 100644
--- a/libc/string/generic/memchr.c
+++ b/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)
diff --git a/libc/string/generic/memcmp.c b/libc/string/generic/memcmp.c
index a3fcba036..13e11692a 100644
--- a/libc/string/generic/memcmp.c
+++ b/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)
diff --git a/libc/string/generic/memcpy.c b/libc/string/generic/memcpy.c
index 2fb48ebef..6db4d0d44 100644
--- a/libc/string/generic/memcpy.c
+++ b/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)
diff --git a/libc/string/generic/memmem.c b/libc/string/generic/memmem.c
index 05d7de639..0353759e3 100644
--- a/libc/string/generic/memmem.c
+++ b/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)
diff --git a/libc/string/generic/memmove.c b/libc/string/generic/memmove.c
index 0e649a1a9..e34b0005d 100644
--- a/libc/string/generic/memmove.c
+++ b/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)
diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c
index f2c860107..d121967cd 100644
--- a/libc/string/generic/mempcpy.c
+++ b/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);
diff --git a/libc/string/generic/memrchr.c b/libc/string/generic/memrchr.c
index 3f7583919..d27ae03ef 100644
--- a/libc/string/generic/memrchr.c
+++ b/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)
diff --git a/libc/string/generic/memset.c b/libc/string/generic/memset.c
index 0185ad57b..91401d7ee 100644
--- a/libc/string/generic/memset.c
+++ b/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)
diff --git a/libc/string/generic/rawmemchr.c b/libc/string/generic/rawmemchr.c
index 02cb8f629..d1be620eb 100644
--- a/libc/string/generic/rawmemchr.c
+++ b/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)
diff --git a/libc/string/generic/strcat.c b/libc/string/generic/strcat.c
index 0996f9a29..96412acc5 100644
--- a/libc/string/generic/strcat.c
+++ b/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)
diff --git a/libc/string/generic/strchr.c b/libc/string/generic/strchr.c
index c776380e2..dcb30ad7b 100644
--- a/libc/string/generic/strchr.c
+++ b/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)
diff --git a/libc/string/generic/strchrnul.c b/libc/string/generic/strchrnul.c
index faa0f4ff9..a2aafbfb0 100644
--- a/libc/string/generic/strchrnul.c
+++ b/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)
diff --git a/libc/string/generic/strcmp.c b/libc/string/generic/strcmp.c
index f12424243..209aeed15 100644
--- a/libc/string/generic/strcmp.c
+++ b/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
diff --git a/libc/string/generic/strcpy.c b/libc/string/generic/strcpy.c
index 08c810f31..9280d3561 100644
--- a/libc/string/generic/strcpy.c
+++ b/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)
diff --git a/libc/string/generic/strcspn.c b/libc/string/generic/strcspn.c
index a10912e25..a06577bca 100644
--- a/libc/string/generic/strcspn.c
+++ b/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)
diff --git a/libc/string/generic/strlen.c b/libc/string/generic/strlen.c
index aca8c2bd9..6c1b5eae3 100644
--- a/libc/string/generic/strlen.c
+++ b/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)
diff --git a/libc/string/generic/strncat.c b/libc/string/generic/strncat.c
index f35e0865b..5ece4d248 100644
--- a/libc/string/generic/strncat.c
+++ b/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)
diff --git a/libc/string/generic/strncmp.c b/libc/string/generic/strncmp.c
index 22aa179b0..849726f6b 100644
--- a/libc/string/generic/strncmp.c
+++ b/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)
diff --git a/libc/string/generic/strncpy.c b/libc/string/generic/strncpy.c
index a43c48502..ca4f59e52 100644
--- a/libc/string/generic/strncpy.c
+++ b/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)
diff --git a/libc/string/generic/strnlen.c b/libc/string/generic/strnlen.c
index ff5c13739..4b96dde31 100644
--- a/libc/string/generic/strnlen.c
+++ b/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)
diff --git a/libc/string/generic/strrchr.c b/libc/string/generic/strrchr.c
index 325be7d48..529016ede 100644
--- a/libc/string/generic/strrchr.c
+++ b/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)
diff --git a/libc/string/generic/strsep.c b/libc/string/generic/strsep.c
index 9515fa193..762b07ff9 100644
--- a/libc/string/generic/strsep.c
+++ b/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)
diff --git a/libc/string/generic/strspn.c b/libc/string/generic/strspn.c
index 1923f8afd..129c58742 100644
--- a/libc/string/generic/strspn.c
+++ b/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)
diff --git a/libc/string/generic/strstr.c b/libc/string/generic/strstr.c
index b16261e56..12e384014 100644
--- a/libc/string/generic/strstr.c
+++ b/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)
diff --git a/libc/string/generic/strtok_r.c b/libc/string/generic/strtok_r.c
index 56eb64bb9..1a11166dd 100644
--- a/libc/string/generic/strtok_r.c
+++ b/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)
diff --git a/libc/string/i386/memchr.c b/libc/string/i386/memchr.c
index 5994a4b67..c7cd33758 100644
--- a/libc/string/i386/memchr.c
+++ b/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)
diff --git a/libc/string/i386/memcpy.c b/libc/string/i386/memcpy.c
index 1cd234685..12ba8d7de 100644
--- a/libc/string/i386/memcpy.c
+++ b/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)
diff --git a/libc/string/i386/memmove.c b/libc/string/i386/memmove.c
index 4bc5f3e42..d6e29e553 100644
--- a/libc/string/i386/memmove.c
+++ b/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)
diff --git a/libc/string/i386/memset.c b/libc/string/i386/memset.c
index 0fd9e2019..eadbf9feb 100644
--- a/libc/string/i386/memset.c
+++ b/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)
diff --git a/libc/string/i386/strcat.c b/libc/string/i386/strcat.c
index eb3c81ec1..02b2a3c5b 100644
--- a/libc/string/i386/strcat.c
+++ b/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)
diff --git a/libc/string/i386/strchr.c b/libc/string/i386/strchr.c
index 5fe689d1a..a8343fa00 100644
--- a/libc/string/i386/strchr.c
+++ b/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)
diff --git a/libc/string/i386/strcmp.c b/libc/string/i386/strcmp.c
index 3786d5983..f335da646 100644
--- a/libc/string/i386/strcmp.c
+++ b/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
diff --git a/libc/string/i386/strcpy.c b/libc/string/i386/strcpy.c
index 1b9bcfded..59effd45e 100644
--- a/libc/string/i386/strcpy.c
+++ b/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)
diff --git a/libc/string/i386/strlen.c b/libc/string/i386/strlen.c
index 859d0928c..01cc46f9e 100644
--- a/libc/string/i386/strlen.c
+++ b/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)
diff --git a/libc/string/i386/strncat.c b/libc/string/i386/strncat.c
index b57568166..b55b87b59 100644
--- a/libc/string/i386/strncat.c
+++ b/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)
diff --git a/libc/string/i386/strncmp.c b/libc/string/i386/strncmp.c
index 825980d4d..2e22bf642 100644
--- a/libc/string/i386/strncmp.c
+++ b/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)
diff --git a/libc/string/i386/strncpy.c b/libc/string/i386/strncpy.c
index db135ee4a..272c60ee4 100644
--- a/libc/string/i386/strncpy.c
+++ b/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)
diff --git a/libc/string/i386/strnlen.c b/libc/string/i386/strnlen.c
index 4fceedf51..ef5c83a9a 100644
--- a/libc/string/i386/strnlen.c
+++ b/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)
diff --git a/libc/string/i386/strrchr.c b/libc/string/i386/strrchr.c
index 8468ee511..9f0f65a36 100644
--- a/libc/string/i386/strrchr.c
+++ b/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)
diff --git a/libc/string/mips/memcpy.S b/libc/string/mips/memcpy.S
index 369c82f39..2e42b1793 100644
--- a/libc/string/mips/memcpy.S
+++ b/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)
diff --git a/libc/string/mips/memset.S b/libc/string/mips/memset.S
index 0919fb82e..4269ebc6e 100644
--- a/libc/string/mips/memset.S
+++ b/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)
diff --git a/libc/string/mips/sysdep.h b/libc/string/mips/sysdep.h
index 89674fef7..27518ac42 100644
--- a/libc/string/mips/sysdep.h
+++ b/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
diff --git a/libc/string/powerpc/memcpy.c b/libc/string/powerpc/memcpy.c
index 34573b29f..5af96869b 100644
--- a/libc/string/powerpc/memcpy.c
+++ b/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)
diff --git a/libc/string/powerpc/memmove.c b/libc/string/powerpc/memmove.c
index b5b70c9fd..1d513a966 100644
--- a/libc/string/powerpc/memmove.c
+++ b/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)
diff --git a/libc/string/powerpc/memset.c b/libc/string/powerpc/memset.c
index 372047797..f6cda9579 100644
--- a/libc/string/powerpc/memset.c
+++ b/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)
diff --git a/libc/string/sh64/memcpy.S b/libc/string/sh64/memcpy.S
index 0ee386a96..d74980613 100644
--- a/libc/string/sh64/memcpy.S
+++ b/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)
diff --git a/libc/string/sh64/memset.S b/libc/string/sh64/memset.S
index d87879717..cd2ad7998 100644
--- a/libc/string/sh64/memset.S
+++ b/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)
diff --git a/libc/string/sh64/strcpy.S b/libc/string/sh64/strcpy.S
index f662cc859..2ce998257 100644
--- a/libc/string/sh64/strcpy.S
+++ b/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)
diff --git a/libc/string/sh64/strlen.S b/libc/string/sh64/strlen.S
index 0f99488d5..673a34dbd 100644
--- a/libc/string/sh64/strlen.S
+++ b/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)
diff --git a/libc/string/sparc/_glibc_inc.h b/libc/string/sparc/_glibc_inc.h
index 7840ba1bf..6ef1dbde6 100644
--- a/libc/string/sparc/_glibc_inc.h
+++ b/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;
diff --git a/libc/string/sparc/sparc32/memchr.S b/libc/string/sparc/sparc32/memchr.S
index e8f44f176..e012844ba 100644
--- a/libc/string/sparc/sparc32/memchr.S
+++ b/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
diff --git a/libc/string/sparc/sparc32/memcpy.S b/libc/string/sparc/sparc32/memcpy.S
index b2a9b1602..a1dd246e6 100644
--- a/libc/string/sparc/sparc32/memcpy.S
+++ b/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)
diff --git a/libc/string/sparc/sparc32/memset.S b/libc/string/sparc/sparc32/memset.S
index ef8a5b634..b60b881be 100644
--- a/libc/string/sparc/sparc32/memset.S
+++ b/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)
diff --git a/libc/string/sparc/sparc32/stpcpy.S b/libc/string/sparc/sparc32/stpcpy.S
index 97a5dce0e..26d2fecbd 100644
--- a/libc/string/sparc/sparc32/stpcpy.S
+++ b/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)
diff --git a/libc/string/sparc/sparc32/strcat.S b/libc/string/sparc/sparc32/strcat.S
index 8efe6aebf..2ee630b23 100644
--- a/libc/string/sparc/sparc32/strcat.S
+++ b/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)
diff --git a/libc/string/sparc/sparc32/strchr.S b/libc/string/sparc/sparc32/strchr.S
index 450b4ffe6..69360c53a 100644
--- a/libc/string/sparc/sparc32/strchr.S
+++ b/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)
diff --git a/libc/string/sparc/sparc32/strcmp.S b/libc/string/sparc/sparc32/strcmp.S
index 2ae1b2ef4..6a807e08a 100644
--- a/libc/string/sparc/sparc32/strcmp.S
+++ b/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)
diff --git a/libc/string/sparc/sparc32/strcpy.S b/libc/string/sparc/sparc32/strcpy.S
index 6dc3517b5..ab57e00a5 100644
--- a/libc/string/sparc/sparc32/strcpy.S
+++ b/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)
diff --git a/libc/string/sparc/sparc32/strlen.S b/libc/string/sparc/sparc32/strlen.S
index 116700e24..81beb7f62 100644
--- a/libc/string/sparc/sparc32/strlen.S
+++ b/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)
diff --git a/libc/string/sparc/sparc64/memchr.S b/libc/string/sparc/sparc64/memchr.S
index a10dfbc63..7017b5540 100644
--- a/libc/string/sparc/sparc64/memchr.S
+++ b/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
diff --git a/libc/string/sparc/sparc64/memcpy.S b/libc/string/sparc/sparc64/memcpy.S
index 47f812a1e..4201b5ec2 100644
--- a/libc/string/sparc/sparc64/memcpy.S
+++ b/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
diff --git a/libc/string/sparc/sparc64/memset.S b/libc/string/sparc/sparc64/memset.S
index 5d2911451..6fb25d211 100644
--- a/libc/string/sparc/sparc64/memset.S
+++ b/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)
diff --git a/libc/string/sparc/sparc64/sparcv9b/memcpy.S b/libc/string/sparc/sparc64/sparcv9b/memcpy.S
index 91e74d438..dd381c7ef 100644
--- a/libc/string/sparc/sparc64/sparcv9b/memcpy.S
+++ b/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
diff --git a/libc/string/sparc/sparc64/stpcpy.S b/libc/string/sparc/sparc64/stpcpy.S
index a66f9d152..6bd24cfee 100644
--- a/libc/string/sparc/sparc64/stpcpy.S
+++ b/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)
diff --git a/libc/string/sparc/sparc64/strcat.S b/libc/string/sparc/sparc64/strcat.S
index 3b81e59e6..fb3ad2d12 100644
--- a/libc/string/sparc/sparc64/strcat.S
+++ b/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)
diff --git a/libc/string/sparc/sparc64/strchr.S b/libc/string/sparc/sparc64/strchr.S
index 6943e8b96..34c30df31 100644
--- a/libc/string/sparc/sparc64/strchr.S
+++ b/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)
diff --git a/libc/string/sparc/sparc64/strcmp.S b/libc/string/sparc/sparc64/strcmp.S
index a4eb36632..0e078e9ac 100644
--- a/libc/string/sparc/sparc64/strcmp.S
+++ b/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)
diff --git a/libc/string/sparc/sparc64/strcpy.S b/libc/string/sparc/sparc64/strcpy.S
index cc906bae7..d9dff104a 100644
--- a/libc/string/sparc/sparc64/strcpy.S
+++ b/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)
diff --git a/libc/string/sparc/sparc64/strlen.S b/libc/string/sparc/sparc64/strlen.S
index 9f48fe6a1..3c1cfc0d8 100644
--- a/libc/string/sparc/sparc64/strlen.S
+++ b/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)
diff --git a/libc/string/x86_64/_glibc_inc.h b/libc/string/x86_64/_glibc_inc.h
index f14b23c94..3c31957db 100644
--- a/libc/string/x86_64/_glibc_inc.h
+++ b/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;
diff --git a/libc/string/x86_64/bzero.S b/libc/string/x86_64/bzero.S
index abd252e7b..73ba75436 100644
--- a/libc/string/x86_64/bzero.S
+++ b/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)
diff --git a/libc/string/x86_64/memcpy.S b/libc/string/x86_64/memcpy.S
index c375bf3fb..973cd513f 100644
--- a/libc/string/x86_64/memcpy.S
+++ b/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
diff --git a/libc/string/x86_64/mempcpy.S b/libc/string/x86_64/mempcpy.S
new file mode 100644
index 000000000..3a8e925fd
--- /dev/null
+++ b/libc/string/x86_64/mempcpy.S
@@ -0,0 +1,3 @@
+#define __memcpy __mempcpy
+#include "memcpy.S"
+strong_alias(__mempcpy,mempcpy)
diff --git a/libc/string/x86_64/memset.S b/libc/string/x86_64/memset.S
index d66195580..923e1c208 100644
--- a/libc/string/x86_64/memset.S
+++ b/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)
diff --git a/libc/string/x86_64/stpcpy.S b/libc/string/x86_64/stpcpy.S
index 83294e1a8..075773371 100644
--- a/libc/string/x86_64/stpcpy.S
+++ b/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)
diff --git a/libc/string/x86_64/strcat.S b/libc/string/x86_64/strcat.S
index 9ee10b202..6c7189a21 100644
--- a/libc/string/x86_64/strcat.S
+++ b/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)
diff --git a/libc/string/x86_64/strchr.S b/libc/string/x86_64/strchr.S
index 04d365a82..312d62b61 100644
--- a/libc/string/x86_64/strchr.S
+++ b/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))
diff --git a/libc/string/x86_64/strcmp.S b/libc/string/x86_64/strcmp.S
index f933c1156..1eaff1691 100644
--- a/libc/string/x86_64/strcmp.S
+++ b/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)
diff --git a/libc/string/x86_64/strcpy.S b/libc/string/x86_64/strcpy.S
index 1a64d2745..0bd2a6471 100644
--- a/libc/string/x86_64/strcpy.S
+++ b/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
diff --git a/libc/string/x86_64/strcspn.S b/libc/string/x86_64/strcspn.S
index e25100bc1..35959e500 100644
--- a/libc/string/x86_64/strcspn.S
+++ b/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
diff --git a/libc/string/x86_64/strlen.S b/libc/string/x86_64/strlen.S
index ab25515f8..77aae71ba 100644
--- a/libc/string/x86_64/strlen.S
+++ b/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)
diff --git a/libc/string/x86_64/strpbrk.S b/libc/string/x86_64/strpbrk.S
index c37befe72..94b14d091 100644
--- a/libc/string/x86_64/strpbrk.S
+++ b/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)
diff --git a/libc/string/x86_64/strspn.S b/libc/string/x86_64/strspn.S
index 8d5903c1b..ae5b4a1df 100644
--- a/libc/string/x86_64/strspn.S
+++ b/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)