diff options
| author | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-14 00:58:03 +0000 | 
|---|---|---|
| committer | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-14 00:58:03 +0000 | 
| commit | af0172162f7c653cad6a11ed1c1a5459bc154465 (patch) | |
| tree | 70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/string | |
| parent | c8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff) | |
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/string')
140 files changed, 708 insertions, 688 deletions
diff --git a/libc/string/__glibc_strerror_r.c b/libc/string/__glibc_strerror_r.c index 54955ec25..0f9cd16a9 100644 --- a/libc/string/__glibc_strerror_r.c +++ b/libc/string/__glibc_strerror_r.c @@ -8,12 +8,13 @@  #include <features.h>  #include <string.h> -char attribute_hidden *__glibc_strerror_r_internal(int errnum, char *strerrbuf, size_t buflen) +libc_hidden_proto(__glibc_strerror_r) +libc_hidden_proto(__xpg_strerror_r) + +char *__glibc_strerror_r(int errnum, char *strerrbuf, size_t buflen)  { -    __xpg_strerror_r_internal(errnum, strerrbuf, buflen); +    __xpg_strerror_r(errnum, strerrbuf, buflen);      return strerrbuf;  } - -strong_alias(__glibc_strerror_r_internal,__glibc_strerror_r) -/*hidden_weak_alias(__glibc_strerror_r_internal,__strerror_r)*/ +libc_hidden_def(__glibc_strerror_r) diff --git a/libc/string/__xpg_strerror_r.c b/libc/string/__xpg_strerror_r.c index 40e114224..6059cbcbd 100644 --- a/libc/string/__xpg_strerror_r.c +++ b/libc/string/__xpg_strerror_r.c @@ -8,9 +8,14 @@  #define _GNU_SOURCE  #include <features.h>  #include <errno.h> +#include <string.h>  #include <bits/uClibc_uintmaxtostr.h>  #include "_syserrmsg.h" +libc_hidden_proto(__xpg_strerror_r) +libc_hidden_proto(memcpy) +libc_hidden_proto(strlen) +  #ifdef __UCLIBC_HAS_ERRNO_MESSAGES__  extern const char _string_syserrmsgs[] attribute_hidden; @@ -154,8 +159,7 @@ static const unsigned char estridx[] = {  #endif -/* __xpg_strerror_r is used in header */ -int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size_t buflen) +int __xpg_strerror_r(int errnum, char *strerrbuf, size_t buflen)  {      register char *s;      int i, retval; @@ -207,20 +211,20 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size  #endif /* __UCLIBC_HAS_ERRNO_MESSAGES__ */      s = _int10tostr(buf+sizeof(buf)-1, errnum) - sizeof(unknown); -    __memcpy(s, unknown, sizeof(unknown)); +    memcpy(s, unknown, sizeof(unknown));   GOT_MESG:      if (!strerrbuf) {		/* SUSv3  */  		buflen = 0;      } -    i = __strlen(s) + 1; +    i = strlen(s) + 1;      if (i > buflen) {  		i = buflen;  		retval = ERANGE;      }      if (i) { -		__memcpy(strerrbuf, s, i); +		memcpy(strerrbuf, s, i);  		strerrbuf[i-1] = 0;	/* In case buf was too small. */      } @@ -233,7 +237,7 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size  #else  /* __UCLIBC_HAS_ERRNO_MESSAGES__ */ -int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size_t buflen) +int __xpg_strerror_r(int errnum, char *strerrbuf, size_t buflen)  {      register char *s;      int i, retval; @@ -243,7 +247,7 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size      };      s = _int10tostr(buf+sizeof(buf)-1, errnum) - sizeof(unknown); -    __memcpy(s, unknown, sizeof(unknown)); +    memcpy(s, unknown, sizeof(unknown));      if (!strerrbuf) {		/* SUSv3  */  		buflen = 0; @@ -259,7 +263,7 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size      }      if (i) { -		__memcpy(strerrbuf, s, i); +		memcpy(strerrbuf, s, i);  		strerrbuf[i-1] = 0;	/* In case buf was too small. */      } @@ -269,5 +273,4 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size  }  #endif /* __UCLIBC_HAS_ERRNO_MESSAGES__ */ - -strong_alias(__xpg_strerror_r_internal,__xpg_strerror_r) +libc_hidden_def(__xpg_strerror_r) diff --git a/libc/string/_collate.c b/libc/string/_collate.c index 35fe7dc1b..5a1f33b82 100644 --- a/libc/string/_collate.c +++ b/libc/string/_collate.c @@ -19,19 +19,14 @@  #include <errno.h>  #include <assert.h> -extern size_t __strlcpy(char *__restrict dst, const char *__restrict src, -                      size_t n) attribute_hidden; - +libc_hidden_proto(memset) +libc_hidden_proto(memcpy) +libc_hidden_proto(strlcpy)  #ifdef WANT_WIDE -extern int __wcscmp (__const wchar_t *__s1, __const wchar_t *__s2) attribute_hidden; -extern size_t __wcsxfrm (wchar_t *__restrict __s1, -		       __const wchar_t *__restrict __s2, size_t __n) attribute_hidden; -#endif -#ifdef __UCLIBC_HAS_XLOCALE__ -extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) attribute_hidden; -extern size_t __strxfrm_l (char *__dest, __const char *__src, size_t __n, __locale_t __l) attribute_hidden; -extern int __wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2, __locale_t __loc) attribute_hidden; -extern size_t __wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2, size_t __n, __locale_t __loc) attribute_hidden; +libc_hidden_proto(wcsxfrm) +libc_hidden_proto(wcscmp) +#else +libc_hidden_proto(strcmp)  #endif  #ifdef __UCLIBC_HAS_LOCALE__ @@ -49,13 +44,9 @@ extern size_t __wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2, size_t __n, __l  #if defined(L_strxfrm) || defined(L_strxfrm_l)  #define wcscoll   strcoll -#define __wcscoll   __strcoll  #define wcscoll_l strcoll_l -#define __wcscoll_l __strcoll_l  #define wcsxfrm   strxfrm -#define __wcsxfrm   __strxfrm  #define wcsxfrm_l strxfrm_l -#define __wcsxfrm_l __strxfrm_l  #undef WANT_WIDE  #undef Wvoid @@ -69,17 +60,23 @@ extern size_t __wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2, size_t __n, __l  #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -int attribute_hidden __wcscoll (const Wchar *s0, const Wchar *s1) +libc_hidden_proto(wcscoll_l) + +int wcscoll (const Wchar *s0, const Wchar *s1)  { -	return __wcscoll_l(s0, s1, __UCLIBC_CURLOCALE ); +	return wcscoll_l(s0, s1, __UCLIBC_CURLOCALE );  } -strong_alias(__wcscoll,wcscoll) +libc_hidden_proto(wcscoll) +libc_hidden_def(wcscoll) -size_t attribute_hidden __wcsxfrm(Wchar *__restrict ws1, const Wchar *__restrict ws2, size_t n) +libc_hidden_proto(wcsxfrm_l) + +size_t wcsxfrm(Wchar *__restrict ws1, const Wchar *__restrict ws2, size_t n)  { -	return __wcsxfrm_l(ws1, ws2, n, __UCLIBC_CURLOCALE ); +	return wcsxfrm_l(ws1, ws2, n, __UCLIBC_CURLOCALE );  } -strong_alias(__wcsxfrm,wcsxfrm) +libc_hidden_proto(wcsxfrm) +libc_hidden_def(wcsxfrm)  #else  /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ @@ -160,7 +157,7 @@ static int lookup(wchar_t wc   __LOCALE_PARAM )  static void init_col_state(col_state_t *cs, const Wchar *wcs)  { -	__memset(cs, 0, sizeof(col_state_t)); +	memset(cs, 0, sizeof(col_state_t));  	cs->s = wcs;  	cs->bp = cs->back_buf = cs->ibb;  	cs->bb_size = 128; @@ -392,7 +389,7 @@ static void next_weight(col_state_t *cs, int pass   __LOCALE_PARAM )  								cs->weight = 0;  								return;  							} -							__memcpy(cs->bp, cs->back_buf, cs->bb_size); +							memcpy(cs->bp, cs->back_buf, cs->bb_size);  						} else {  							cs->bp = realloc(cs->back_buf, cs->bb_size + 128); @@ -517,16 +514,16 @@ static void next_weight(col_state_t *cs, int pass   __LOCALE_PARAM )  	} while (1);  } -int attribute_hidden __UCXL(wcscoll) (const Wchar *s0, const Wchar *s1   __LOCALE_PARAM ) +int __XL_NPP(wcscoll) (const Wchar *s0, const Wchar *s1   __LOCALE_PARAM )  {  	col_state_t ws[2];  	int pass;  	if (!CUR_COLLATE->num_weights) { /* C locale */  #ifdef WANT_WIDE -		return __wcscmp(s0, s1); +		return wcscmp(s0, s1);  #else  /* WANT_WIDE */ -		return __strcmp(s0, s1); +		return strcmp(s0, s1);  #endif /* WANT_WIDE */  	} @@ -550,11 +547,15 @@ int attribute_hidden __UCXL(wcscoll) (const Wchar *s0, const Wchar *s1   __LOCAL  	return 0;  } -__UCXL_ALIAS(wcscoll) +libc_hidden_proto(__XL_NPP(wcscoll)) +libc_hidden_def(__XL_NPP(wcscoll))  #ifdef WANT_WIDE -size_t attribute_hidden __UCXL(wcsxfrm)(wchar_t *__restrict ws1, const wchar_t *__restrict ws2, +extern size_t __wcslcpy(wchar_t *__restrict dst, +		const wchar_t *__restrict src, size_t n); + +size_t __XL_NPP(wcsxfrm)(wchar_t *__restrict ws1, const wchar_t *__restrict ws2,  					 size_t n   __LOCALE_PARAM )  {  	col_state_t cs; @@ -562,7 +563,7 @@ size_t attribute_hidden __UCXL(wcsxfrm)(wchar_t *__restrict ws1, const wchar_t *  	int pass;  	if (!CUR_COLLATE->num_weights) { /* C locale */ -		return __wcsxfrm(ws1, ws2, n); +		return __wcslcpy(ws1, ws2, n);  	}  #ifdef __UCLIBC_MJN3_ONLY__ @@ -591,8 +592,8 @@ size_t attribute_hidden __UCXL(wcsxfrm)(wchar_t *__restrict ws1, const wchar_t *  	}  	return count-1;  } - -__UCXL_ALIAS(wcsxfrm) +libc_hidden_proto(__XL_NPP(wcsxfrm)) +libc_hidden_def(__XL_NPP(wcsxfrm))  #else  /* WANT_WIDE */ @@ -636,7 +637,7 @@ static size_t store(unsigned char *s, size_t count, size_t n, __uwchar_t weight)  	return r;  } -size_t attribute_hidden __UCXL(strxfrm)(char *__restrict ws1, const char *__restrict ws2, size_t n +size_t __XL_NPP(strxfrm)(char *__restrict ws1, const char *__restrict ws2, size_t n  					 __LOCALE_PARAM )  {  	col_state_t cs; @@ -644,7 +645,7 @@ size_t attribute_hidden __UCXL(strxfrm)(char *__restrict ws1, const char *__rest  	int pass;  	if (!CUR_COLLATE->num_weights) { /* C locale */ -		return __strlcpy(ws1, ws2, n); +		return strlcpy(ws1, ws2, n);  	}  #ifdef __UCLIBC_MJN3_ONLY__ @@ -673,8 +674,8 @@ size_t attribute_hidden __UCXL(strxfrm)(char *__restrict ws1, const char *__rest  	}  	return count-1;  } - -__UCXL_ALIAS(strxfrm) +libc_hidden_proto(__XL_NPP(strxfrm)) +libc_hidden_def(__XL_NPP(strxfrm))  #endif /* WANT_WIDE */ diff --git a/libc/string/arm/bcopy.S b/libc/string/arm/bcopy.S index 2914b8972..dde4f6027 100644 --- a/libc/string/arm/bcopy.S +++ b/libc/string/arm/bcopy.S @@ -42,18 +42,17 @@  #include <features.h>  .text -.global __bcopy -.hidden __bcopy -.type __bcopy,%function +.global bcopy +.type bcopy,%function  .align 4 -__bcopy: +bcopy:  	/* switch the source and destination registers */  	eor     r0, r1, r0   	eor     r1, r0, r1   	eor     r0, r1, r0  -	b	_memcpy (PLT) +	b	_memcpy /* (PLT) */ -.size __bcopy,.-__bcopy +.size bcopy,.-bcopy -strong_alias(__bcopy,bcopy) +libc_hidden_def(bcopy) diff --git a/libc/string/arm/bzero.S b/libc/string/arm/bzero.S index 2cb67097e..1f679f5b7 100644 --- a/libc/string/arm/bzero.S +++ b/libc/string/arm/bzero.S @@ -40,16 +40,15 @@  #include <features.h>  .text -.global __bzero -.hidden __bzero -.type __bzero,%function +.global bzero +.type bzero,%function  .align 4 -__bzero: +bzero:  	mov	r2, r1  	mov	r1, #0 -	b	__memset +	b	HIDDEN_JUMPTARGET(memset) -.size __bzero,.-__bzero +.size bzero,.-bzero -strong_alias(__bzero,bzero) +libc_hidden_def(bzero) diff --git a/libc/string/arm/memcmp.S b/libc/string/arm/memcmp.S index a97e02742..e97bbc480 100644 --- a/libc/string/arm/memcmp.S +++ b/libc/string/arm/memcmp.S @@ -32,12 +32,11 @@  #include <features.h>  .text -.global __memcmp -.hidden __memcmp -.type __memcmp,%function +.global memcmp +.type memcmp,%function  .align 4 -__memcmp: +memcmp:  	/* if ((len - 1) < 0) return 0 */  	subs	r2, r2, #1  	movmi	r0, #0 @@ -54,7 +53,7 @@ __memcmp:  	sub	r0, r2, r3  	mov	pc, lr -.size __memcmp,.-__memcmp +.size memcmp,.-memcmp -strong_alias(__memcmp,memcmp) -strong_alias(__memcmp,bcmp) +libc_hidden_def(memcmp) +strong_alias(memcmp,bcmp) diff --git a/libc/string/arm/memcpy.S b/libc/string/arm/memcpy.S index 8f81a15e5..7a5b6ab76 100644 --- a/libc/string/arm/memcpy.S +++ b/libc/string/arm/memcpy.S @@ -40,16 +40,15 @@  #include <features.h>  .text -.global __memcpy -.hidden __memcpy -.type __memcpy,%function +.global memcpy +.type memcpy,%function  .align 4 -__memcpy: +memcpy:  	stmfd	sp!, {r0, lr}  	bl	_memcpy  	ldmfd	sp!, {r0, pc} -.size __memcpy,.-__memcpy +.size memcpy,.-memcpy -strong_alias(__memcpy,memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/arm/memmove.S b/libc/string/arm/memmove.S index a26cf731e..45cd9b4d4 100644 --- a/libc/string/arm/memmove.S +++ b/libc/string/arm/memmove.S @@ -40,16 +40,15 @@  #include <features.h>  .text -.global __memmove -.hidden __memmove -.type __memmove,%function +.global memmove +.type memmove,%function  .align 4 -__memmove: +memmove:  	stmfd	sp!, {r0, lr}  	bl	_memcpy  	ldmfd	sp!, {r0, pc} -.size __memmove,.-__memmove +.size memmove,.-memmove -strong_alias(__memmove,memmove) +libc_hidden_def(memmove) diff --git a/libc/string/arm/memset.S b/libc/string/arm/memset.S index dea05a6b0..476dad52a 100644 --- a/libc/string/arm/memset.S +++ b/libc/string/arm/memset.S @@ -21,12 +21,11 @@  #include <sys/syscall.h>  .text -.global __memset -.hidden __memset -.type __memset,%function +.global memset +.type memset,%function  .align 4 -__memset: +memset:  	mov	a4, a1  	cmp	a3, $8		@ at least 8 bytes to do?  	blt	2f @@ -70,6 +69,6 @@ __memset:  	strb	a2, [a4], $1  	mov	pc, lr -.size __memset,.-__memset +.size memset,.-memset -strong_alias(__memset,memset) +libc_hidden_def(memset) diff --git a/libc/string/arm/strcmp.S b/libc/string/arm/strcmp.S index 3f462dec0..cdc4ac469 100644 --- a/libc/string/arm/strcmp.S +++ b/libc/string/arm/strcmp.S @@ -32,12 +32,11 @@  #include <features.h>  .text -.global __strcmp -.hidden __strcmp -.type __strcmp,%function +.global strcmp +.type strcmp,%function  .align 4 -__strcmp: +strcmp:  1:  	ldrb	r2, [r0], #1  	ldrb	r3, [r1], #1 @@ -47,10 +46,10 @@ __strcmp:  	sub	r0, r2, r3  	mov	pc, lr -.size __strcmp,.-__strcmp +.size strcmp,.-strcmp -strong_alias(__strcmp,strcmp) +libc_hidden_def(strcmp)  #ifndef __UCLIBC_HAS_LOCALE__ -hidden_strong_alias(__strcmp,__strcoll) -strong_alias(__strcmp,strcoll) +strong_alias(strcmp,strcoll) +libc_hidden_def(strcoll)  #endif diff --git a/libc/string/arm/strlen.S b/libc/string/arm/strlen.S index f623cbe20..b7af3480d 100644 --- a/libc/string/arm/strlen.S +++ b/libc/string/arm/strlen.S @@ -27,12 +27,11 @@   */  .text -.global __strlen -.hidden __strlen -.type __strlen,%function +.global strlen +.type strlen,%function  .align 4 -__strlen: +strlen:  	bic     r1, r0, $3              @ addr of word containing first byte  	ldr     r2, [r1], $4            @ get the first word  	ands    r3, r0, $3              @ how many bytes are duff? @@ -78,6 +77,6 @@ Llastword:				@ drop through to here once we find a  #endif  	mov	pc,lr -.size __strlen,.-__strlen +.size strlen,.-strlen -strong_alias(__strlen,strlen) +libc_hidden_def(strlen) diff --git a/libc/string/arm/strncmp.S b/libc/string/arm/strncmp.S index a3278727e..82d45e8f3 100644 --- a/libc/string/arm/strncmp.S +++ b/libc/string/arm/strncmp.S @@ -32,12 +32,11 @@  #include <features.h>  .text -.global __strncmp -.hidden __strncmp -.type __strncmp,%function +.global strncmp +.type strncmp,%function  .align 4 -__strncmp: +strncmp:  	/* if (len == 0) return 0 */  	cmp	r2, #0  	moveq	r0, #0 @@ -56,6 +55,6 @@ __strncmp:  	sub	r0, r2, r3  	mov	pc, lr -.size __strncmp,.-__strncmp +.size strncmp,.-strncmp -strong_alias(__strncmp,strncmp) +libc_hidden_def(strncmp) diff --git a/libc/string/basename.c b/libc/string/basename.c index 403cd770b..2c4937fca 100644 --- a/libc/string/basename.c +++ b/libc/string/basename.c @@ -7,7 +7,9 @@  #include "_string.h" -char attribute_hidden *__basename(const char *path) +libc_hidden_proto(basename) + +char *basename(const char *path)  {  	register const char *s;  	register const char *p; @@ -22,5 +24,4 @@ char attribute_hidden *__basename(const char *path)  	return (char *) p;  } - -strong_alias(__basename,basename) +libc_hidden_def(basename) diff --git a/libc/string/bcopy.c b/libc/string/bcopy.c index 59e586b34..7e4f2328a 100644 --- a/libc/string/bcopy.c +++ b/libc/string/bcopy.c @@ -7,10 +7,13 @@  #include "_string.h" -void attribute_hidden __bcopy(const void *s2, void *s1, size_t n) +libc_hidden_proto(bcopy) +libc_hidden_proto(memmove) + +void bcopy(const void *s2, void *s1, size_t n)  {  #if 1 -	__memmove(s1, s2, n); +	memmove(s1, s2, n);  #else  #ifdef __BCC__  	register char *s; @@ -49,5 +52,4 @@ void attribute_hidden __bcopy(const void *s2, void *s1, size_t n)  #endif  #endif  } - -strong_alias(__bcopy,bcopy) +libc_hidden_def(bcopy) diff --git a/libc/string/bzero.c b/libc/string/bzero.c index 0439e39a1..30bdf5674 100644 --- a/libc/string/bzero.c +++ b/libc/string/bzero.c @@ -7,10 +7,12 @@  #include "_string.h" -void attribute_hidden __bzero(void *s, size_t n) +libc_hidden_proto(memset) + +void bzero(void *s, size_t n)  {  #if 1 -	(void)__memset(s, 0, n); +	(void)memset(s, 0, n);  #else  	register unsigned char *p = s;  #ifdef __BCC__ @@ -27,5 +29,3 @@ void attribute_hidden __bzero(void *s, size_t n)  #endif  }  #undef np - -strong_alias(__bzero,bzero) diff --git a/libc/string/ffs.c b/libc/string/ffs.c index fc76e6c70..d98383d4e 100644 --- a/libc/string/ffs.c +++ b/libc/string/ffs.c @@ -9,7 +9,9 @@  #include "_string.h" -int attribute_hidden __ffs(int i) +libc_hidden_proto(ffs) + +int ffs(int i)  {  #if 1  	/* inlined binary search method */ @@ -50,5 +52,4 @@ int attribute_hidden __ffs(int i)  	return n;  #endif  } - -strong_alias(__ffs,ffs) +libc_hidden_def(ffs) diff --git a/libc/string/frv/memcpy.S b/libc/string/frv/memcpy.S index abd8a28db..ae843797d 100644 --- a/libc/string/frv/memcpy.S +++ b/libc/string/frv/memcpy.S @@ -31,10 +31,9 @@  #         to caller's fixup routine, aborting the remainder of the copy  #  ############################################################################### -        .globl		__memcpy -        .hidden		__memcpy -        .type		__memcpy,@function -__memcpy: +        .globl		memcpy +        .type		memcpy,@function +memcpy:  	or.p		gr8,gr9,gr4  	orcc		gr10,gr0,gr0,icc3  	or.p		gr10,gr4,gr4 @@ -123,6 +122,6 @@ memcpy_32:  	bne		icc0,#2,0b  	bralr -	.size		__memcpy, .-__memcpy +	.size		memcpy, .-memcpy -strong_alias(__memcpy,memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/frv/memset.S b/libc/string/frv/memset.S index a548b3779..4e64550e4 100644 --- a/libc/string/frv/memset.S +++ b/libc/string/frv/memset.S @@ -32,10 +32,9 @@  #         GR4, GR7, GR8, and GR11 must be managed  #  ############################################################################### -        .globl		__memset -        .hidden		__memset -        .type		__memset,@function -__memset: +        .globl		memset +        .type		memset,@function +memset:  	orcc.p		gr10,gr0,gr5,icc3		; GR5 = count  	andi		gr9,#0xff,gr9  	or.p		gr8,gr0,gr4			; GR4 = address @@ -154,6 +153,6 @@ __memset:  	cknc		icc0,cc7  	cstb.p		gr12,@(gr4,gr0)		,cc7,#1  	bralr -	.size		__memset, .-__memset +	.size		memset, .-memset -strong_alias(__memset,memset) +libc_hidden_proto(memset) diff --git a/libc/string/generic/memchr.c b/libc/string/generic/memchr.c index 68c820814..9942b609b 100644 --- a/libc/string/generic/memchr.c +++ b/libc/string/generic/memchr.c @@ -25,12 +25,14 @@  #include <stdlib.h>  #include <limits.h> +libc_hidden_proto(abort) +  #include "memcopy.h"  #define LONG_MAX_32_BITS 2147483647  /* Search no more than N bytes of S for C.  */ -void attribute_hidden *__memchr (const void * s, int c_in, size_t n) +void *memchr (const void * s, int c_in, size_t n)  {    const unsigned char *char_ptr;    const unsigned long int *longword_ptr; @@ -171,5 +173,5 @@ void attribute_hidden *__memchr (const void * s, int c_in, size_t n)    return 0;  } - -strong_alias(__memchr,memchr) +libc_hidden_proto(memchr) +libc_hidden_def(memchr) diff --git a/libc/string/generic/memcmp.c b/libc/string/generic/memcmp.c index 13e11692a..13de370bb 100644 --- a/libc/string/generic/memcmp.c +++ b/libc/string/generic/memcmp.c @@ -273,7 +273,7 @@ memcmp_not_common_alignment (srcp1, srcp2, len)  }  int -attribute_hidden __memcmp (const __ptr_t s1, const __ptr_t s2, size_t len) +memcmp (const __ptr_t s1, const __ptr_t s2, size_t len)  {    op_t a0;    op_t b0; @@ -329,7 +329,6 @@ attribute_hidden __memcmp (const __ptr_t s1, const __ptr_t s2, size_t len)    return 0;  } - -strong_alias(__memcmp,memcmp) - -strong_alias(__memcmp,bcmp) +libc_hidden_proto(memcmp) +libc_hidden_def(memcmp) +strong_alias(memcmp,bcmp) diff --git a/libc/string/generic/memcpy.c b/libc/string/generic/memcpy.c index 6db4d0d44..692a254f7 100644 --- a/libc/string/generic/memcpy.c +++ b/libc/string/generic/memcpy.c @@ -209,7 +209,7 @@ static void _wordcopy_fwd_dest_aligned (long int dstp, long int srcp, size_t len    ((op_t *) dstp)[0] = MERGE (a2, sh_1, a3, sh_2);  } -void attribute_hidden *__memcpy (void *dstpp, const void *srcpp, size_t len) +void *memcpy (void *dstpp, const void *srcpp, size_t len)  {    unsigned long int dstp = (long int) dstpp;    unsigned long int srcp = (long int) srcpp; @@ -242,5 +242,5 @@ void attribute_hidden *__memcpy (void *dstpp, const void *srcpp, size_t len)    return dstpp;  } - -strong_alias(__memcpy,memcpy) +libc_hidden_proto(memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/generic/memmem.c b/libc/string/generic/memmem.c index 0353759e3..e8982c078 100644 --- a/libc/string/generic/memmem.c +++ b/libc/string/generic/memmem.c @@ -19,8 +19,10 @@  #include <string.h>  #include <stddef.h> +libc_hidden_proto(memcmp) +  /* Return the first occurrence of NEEDLE in HAYSTACK.  */ -void attribute_hidden *__memmem (const void *haystack, size_t haystack_len, +void *memmem (const void *haystack, size_t haystack_len,  			  const void *needle,  size_t needle_len)  {    const char *begin; @@ -39,12 +41,12 @@ void attribute_hidden *__memmem (const void *haystack, size_t haystack_len,    for (begin = (const char *) haystack; begin <= last_possible; ++begin)      if (begin[0] == ((const char *) needle)[0] && -	!__memcmp ((const void *) &begin[1], +	!memcmp ((const void *) &begin[1],  		 (const void *) ((const char *) needle + 1),  		 needle_len - 1))        return (void *) begin;    return NULL;  } - -strong_alias(__memmem,memmem) +libc_hidden_proto(memmem) +libc_hidden_def(memmem) diff --git a/libc/string/generic/memmove.c b/libc/string/generic/memmove.c index e34b0005d..0157b148c 100644 --- a/libc/string/generic/memmove.c +++ b/libc/string/generic/memmove.c @@ -24,6 +24,8 @@  #include "memcopy.h"  #include "pagecopy.h" +libc_hidden_proto(memcpy) +  static void _wordcopy_bwd_aligned (long int dstp, long int srcp, size_t len)  {    op_t a0, a1; @@ -206,7 +208,7 @@ 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);  } -void attribute_hidden *__memmove (void *dest, const void *src, size_t len) +void *memmove (void *dest, const void *src, size_t len)  {    unsigned long int dstp = (long int) dest;    unsigned long int srcp = (long int) src; @@ -217,7 +219,7 @@ void attribute_hidden *__memmove (void *dest, const void *src, size_t len)      {  #if 1  #warning REMINDER: generic-opt memmove assumes memcpy does forward copying! -      __memcpy(dest, src, len); +      memcpy(dest, src, len);  #else        /* Copy from the beginning to the end.  */ @@ -276,5 +278,5 @@ void attribute_hidden *__memmove (void *dest, const void *src, size_t len)    return (dest);  } - -strong_alias(__memmove,memmove) +libc_hidden_proto(memmove) +libc_hidden_def(memmove) diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c index d121967cd..ea4dec2b1 100644 --- a/libc/string/generic/mempcpy.c +++ b/libc/string/generic/mempcpy.c @@ -7,10 +7,12 @@  #include <string.h> -void attribute_hidden *__mempcpy (void *dstpp, const void *srcpp, size_t len) +libc_hidden_proto(memcpy) + +void *mempcpy (void *dstpp, const void *srcpp, size_t len)  { -  __memcpy(dstpp, srcpp, len); +  memcpy(dstpp, srcpp, len);    return (void *)(((char *)dstpp) + len);  } - -strong_alias(__mempcpy,mempcpy) +libc_hidden_proto(mempcpy) +libc_hidden_def(mempcpy) diff --git a/libc/string/generic/memrchr.c b/libc/string/generic/memrchr.c index d27ae03ef..ab61eac72 100644 --- a/libc/string/generic/memrchr.c +++ b/libc/string/generic/memrchr.c @@ -26,12 +26,14 @@  #include <stdlib.h>  #include <limits.h> +libc_hidden_proto(abort) +  #include "memcopy.h"  #define LONG_MAX_32_BITS 2147483647  /* Search no more than N bytes of S for C.  */ -void attribute_hidden *__memrchr (const void * s, int c_in, size_t n) +void *memrchr (const void * s, int c_in, size_t n)  {    const unsigned char *char_ptr;    const unsigned long int *longword_ptr; @@ -170,5 +172,5 @@ void attribute_hidden *__memrchr (const void * s, int c_in, size_t n)    return 0;  } - -strong_alias(__memrchr,memrchr) +libc_hidden_proto(memrchr) +libc_hidden_def(memrchr) diff --git a/libc/string/generic/memset.c b/libc/string/generic/memset.c index 91401d7ee..18c065cac 100644 --- a/libc/string/generic/memset.c +++ b/libc/string/generic/memset.c @@ -19,7 +19,7 @@  #include <string.h>  #include "memcopy.h" -void attribute_hidden *__memset (void *dstpp, int c, size_t len) +void *memset (void *dstpp, int c, size_t len)  {    long int dstp = (long int) dstpp; @@ -82,5 +82,5 @@ void attribute_hidden *__memset (void *dstpp, int c, size_t len)    return dstpp;  } - -strong_alias(__memset,memset) +libc_hidden_proto(memset) +libc_hidden_def(memset) diff --git a/libc/string/generic/rawmemchr.c b/libc/string/generic/rawmemchr.c index d1be620eb..3fc0e52f3 100644 --- a/libc/string/generic/rawmemchr.c +++ b/libc/string/generic/rawmemchr.c @@ -25,12 +25,14 @@  #include <stdlib.h>  #include <limits.h> +libc_hidden_proto(abort) +  #include "memcopy.h"  #define LONG_MAX_32_BITS 2147483647  /* Find the first occurrence of C in S.  */ -void attribute_hidden *__rawmemchr (const void * s, int c_in) +void *rawmemchr (const void * s, int c_in)  {    const unsigned char *char_ptr;    const unsigned long int *longword_ptr; @@ -156,5 +158,5 @@ void attribute_hidden *__rawmemchr (const void * s, int c_in)  	}      }  } - -strong_alias(__rawmemchr,rawmemchr) +libc_hidden_proto(rawmemchr) +libc_hidden_def(rawmemchr) diff --git a/libc/string/generic/strcat.c b/libc/string/generic/strcat.c index 96412acc5..5111a9a0f 100644 --- a/libc/string/generic/strcat.c +++ b/libc/string/generic/strcat.c @@ -20,7 +20,7 @@  #include "memcopy.h"  /* Append SRC on the end of DEST.  */ -char attribute_hidden *__strcat (char *dest, const char *src) +char *strcat (char *dest, const char *src)  {    char *s1 = dest;    const char *s2 = src; @@ -44,5 +44,5 @@ char attribute_hidden *__strcat (char *dest, const char *src)    return dest;  } - -strong_alias(__strcat,strcat) +libc_hidden_proto(strcat) +libc_hidden_def(strcat) diff --git a/libc/string/generic/strchr.c b/libc/string/generic/strchr.c index dcb30ad7b..5675ce4ba 100644 --- a/libc/string/generic/strchr.c +++ b/libc/string/generic/strchr.c @@ -24,10 +24,12 @@  #include <string.h>  #include <stdlib.h> +libc_hidden_proto(abort) +  #include "memcopy.h"  /* Find the first occurrence of C in S.  */ -char attribute_hidden *__strchr (const char *s, int c_in) +char *strchr (const char *s, int c_in)  {    const unsigned char *char_ptr;    const unsigned long int *longword_ptr; @@ -178,7 +180,6 @@ char attribute_hidden *__strchr (const char *s, int c_in)    return NULL;  } - -strong_alias(__strchr,strchr) - -strong_alias(__strchr,index) +libc_hidden_proto(strchr) +libc_hidden_def(strchr) +strong_alias(strchr,index) diff --git a/libc/string/generic/strchrnul.c b/libc/string/generic/strchrnul.c index a2aafbfb0..eccdba247 100644 --- a/libc/string/generic/strchrnul.c +++ b/libc/string/generic/strchrnul.c @@ -24,10 +24,12 @@  #include <string.h>  #include <stdlib.h> +libc_hidden_proto(abort) +  #include "memcopy.h"  /* Find the first occurrence of C in S or the final NUL byte.  */ -char attribute_hidden *__strchrnul (const char *s, int c_in) +char *strchrnul (const char *s, int c_in)  {    const unsigned char *char_ptr;    const unsigned long int *longword_ptr; @@ -161,5 +163,5 @@ char attribute_hidden *__strchrnul (const char *s, int c_in)    /* This should never happen.  */    return NULL;  } - -strong_alias(__strchrnul,strchrnul) +libc_hidden_proto(strchrnul) +libc_hidden_def(strchrnul) diff --git a/libc/string/generic/strcmp.c b/libc/string/generic/strcmp.c index 209aeed15..1049934a8 100644 --- a/libc/string/generic/strcmp.c +++ b/libc/string/generic/strcmp.c @@ -23,7 +23,7 @@  /* 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.  */ -int attribute_hidden __strcmp (const char *p1, const char *p2) +int strcmp (const char *p1, const char *p2)  {    register const unsigned char *s1 = (const unsigned char *) p1;    register const unsigned char *s2 = (const unsigned char *) p2; @@ -40,10 +40,11 @@ int attribute_hidden __strcmp (const char *p1, const char *p2)    return c1 - c2;  } - -strong_alias(__strcmp,strcmp) +libc_hidden_proto(strcmp) +libc_hidden_def(strcmp)  #ifndef __UCLIBC_HAS_LOCALE__ -hidden_strong_alias(__strcmp,__strcoll) -strong_alias(__strcmp,strcoll) +strong_alias(strcmp,strcoll) +libc_hidden_proto(strcoll) +libc_hidden_def(strcoll)  #endif diff --git a/libc/string/generic/strcpy.c b/libc/string/generic/strcpy.c index 9280d3561..ab2928e55 100644 --- a/libc/string/generic/strcpy.c +++ b/libc/string/generic/strcpy.c @@ -23,7 +23,7 @@  #include "bp-checks.h"  /* Copy SRC to DEST.  */ -char attribute_hidden *__strcpy (char *dest, const char *src) +char *strcpy (char *dest, const char *src)  {    reg_char c;    char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src); @@ -43,5 +43,5 @@ char attribute_hidden *__strcpy (char *dest, const char *src)    return dest;  } - -strong_alias(__strcpy,strcpy) +libc_hidden_proto(strcpy) +libc_hidden_def(strcpy) diff --git a/libc/string/generic/strcspn.c b/libc/string/generic/strcspn.c index a06577bca..7fa49a0dc 100644 --- a/libc/string/generic/strcspn.c +++ b/libc/string/generic/strcspn.c @@ -18,19 +18,21 @@  #include <string.h> +libc_hidden_proto(strchr) +  /* 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) +size_t strcspn (const char *s, const char *reject)  {    size_t count = 0;    while (*s != '\0') -    if (__strchr (reject, *s++) == NULL) +    if (strchr (reject, *s++) == NULL)        ++count;      else        return count;    return count;  } - -strong_alias(__strcspn,strcspn) +libc_hidden_proto(strcspn) +libc_hidden_def(strcspn) diff --git a/libc/string/generic/strlen.c b/libc/string/generic/strlen.c index 6c1b5eae3..08b5fa830 100644 --- a/libc/string/generic/strlen.c +++ b/libc/string/generic/strlen.c @@ -22,9 +22,11 @@  #include <string.h>  #include <stdlib.h> +libc_hidden_proto(abort) +  /* 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) +size_t strlen (const char *str)  {    const char *char_ptr;    const unsigned long int *longword_ptr; @@ -146,5 +148,5 @@ size_t attribute_hidden __strlen (const char *str)  	}      }  } - -strong_alias(__strlen,strlen) +libc_hidden_proto(strlen) +libc_hidden_def(strlen) diff --git a/libc/string/generic/strncat.c b/libc/string/generic/strncat.c index 5ece4d248..0cdb21a7a 100644 --- a/libc/string/generic/strncat.c +++ b/libc/string/generic/strncat.c @@ -20,7 +20,7 @@  #include "memcopy.h" -char attribute_hidden *__strncat (char *s1, const char *s2, size_t n) +char *strncat (char *s1, const char *s2, size_t n)  {    reg_char c;    char *s = s1; @@ -73,5 +73,5 @@ char attribute_hidden *__strncat (char *s1, const char *s2, size_t n)    return s;  } - -strong_alias(__strncat,strncat) +libc_hidden_proto(strncat) +libc_hidden_def(strncat) diff --git a/libc/string/generic/strncmp.c b/libc/string/generic/strncmp.c index 849726f6b..a6285e3a4 100644 --- a/libc/string/generic/strncmp.c +++ b/libc/string/generic/strncmp.c @@ -23,7 +23,7 @@     returning less than, equal to or greater than zero     if S1 is lexicographically less than, equal to or     greater than S2.  */ -int attribute_hidden __strncmp (const char *s1, const char *s2, size_t n) +int strncmp (const char *s1, const char *s2, size_t n)  {    unsigned reg_char c1 = '\0';    unsigned reg_char c2 = '\0'; @@ -64,5 +64,5 @@ int attribute_hidden __strncmp (const char *s1, const char *s2, size_t n)    return c1 - c2;  } - -strong_alias(__strncmp,strncmp) +libc_hidden_proto(strncmp) +libc_hidden_def(strncmp) diff --git a/libc/string/generic/strncpy.c b/libc/string/generic/strncpy.c index ca4f59e52..3c9ccb9ce 100644 --- a/libc/string/generic/strncpy.c +++ b/libc/string/generic/strncpy.c @@ -19,7 +19,7 @@  #include <string.h>  #include "memcopy.h" -char attribute_hidden *__strncpy (char *s1, const char *s2, size_t n) +char *strncpy (char *s1, const char *s2, size_t n)  {    reg_char c;    char *s = s1; @@ -78,5 +78,5 @@ char attribute_hidden *__strncpy (char *s1, const char *s2, size_t n)    return s;  } - -strong_alias(__strncpy,strncpy) +libc_hidden_proto(strncpy) +libc_hidden_def(strncpy) diff --git a/libc/string/generic/strnlen.c b/libc/string/generic/strnlen.c index 4b96dde31..95e8a77be 100644 --- a/libc/string/generic/strnlen.c +++ b/libc/string/generic/strnlen.c @@ -24,9 +24,11 @@  #include <string.h>  #include <stdlib.h> +libc_hidden_proto(abort) +  /* 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) +size_t strnlen (const char *str, size_t maxlen)  {    const char *char_ptr, *end_ptr = str + maxlen;    const unsigned long int *longword_ptr; @@ -156,5 +158,5 @@ size_t attribute_hidden __strnlen (const char *str, size_t maxlen)      char_ptr = end_ptr;    return char_ptr - str;  } - -strong_alias(__strnlen,strnlen) +libc_hidden_proto(strnlen) +libc_hidden_def(strnlen) diff --git a/libc/string/generic/strrchr.c b/libc/string/generic/strrchr.c index 529016ede..cf4c6dd3b 100644 --- a/libc/string/generic/strrchr.c +++ b/libc/string/generic/strrchr.c @@ -18,8 +18,10 @@  #include <string.h> +libc_hidden_proto(strchr) +  /* Find the last occurrence of C in S.  */ -char attribute_hidden *__strrchr (const char *s, int c) +char *strrchr (const char *s, int c)  {    register const char *found, *p; @@ -28,10 +30,10 @@ char attribute_hidden *__strrchr (const char *s, int c)    /* Since strchr is fast, we use it rather than the obvious loop.  */    if (c == '\0') -    return __strchr (s, '\0'); +    return strchr (s, '\0');    found = NULL; -  while ((p = __strchr (s, c)) != NULL) +  while ((p = strchr (s, c)) != NULL)      {        found = p;        s = p + 1; @@ -39,7 +41,6 @@ char attribute_hidden *__strrchr (const char *s, int c)    return (char *) found;  } - -strong_alias(__strrchr,strrchr) - -strong_alias (__strrchr,rindex) +libc_hidden_proto(strrchr) +libc_hidden_def(strrchr) +strong_alias(strrchr,rindex) diff --git a/libc/string/generic/strsep.c b/libc/string/generic/strsep.c index 762b07ff9..5d9c8c307 100644 --- a/libc/string/generic/strsep.c +++ b/libc/string/generic/strsep.c @@ -16,11 +16,12 @@     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA     02111-1307 USA.  */ -#define strpbrk __strpbrk -  #include <string.h> -char attribute_hidden *__strsep (char **stringp, const char *delim) +libc_hidden_proto(strchr) +libc_hidden_proto(strpbrk) + +char *strsep (char **stringp, const char *delim)  {    char *begin, *end; @@ -44,7 +45,7 @@ char attribute_hidden *__strsep (char **stringp, const char *delim)  	  else if (*begin == '\0')  	    end = NULL;  	  else -	    end = __strchr (begin + 1, ch); +	    end = strchr (begin + 1, ch);  	}      }    else @@ -63,5 +64,5 @@ char attribute_hidden *__strsep (char **stringp, const char *delim)    return begin;  } - -strong_alias(__strsep,strsep) +libc_hidden_proto(strsep) +libc_hidden_def(strsep) diff --git a/libc/string/generic/strspn.c b/libc/string/generic/strspn.c index 129c58742..cd2882456 100644 --- a/libc/string/generic/strspn.c +++ b/libc/string/generic/strspn.c @@ -20,7 +20,7 @@  /* 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) +size_t strspn (const char *s, const char *accept)  {    const char *p;    const char *a; @@ -39,5 +39,5 @@ size_t attribute_hidden __strspn (const char *s, const char *accept)    return count;  } - -strong_alias(__strspn,strspn) +libc_hidden_proto(strspn) +libc_hidden_def(strspn) diff --git a/libc/string/generic/strstr.c b/libc/string/generic/strstr.c index 12e384014..a7442d614 100644 --- a/libc/string/generic/strstr.c +++ b/libc/string/generic/strstr.c @@ -30,7 +30,7 @@  typedef unsigned chartype; -char attribute_hidden *__strstr (const char *phaystack, const char *pneedle) +char *strstr (const char *phaystack, const char *pneedle)  {    const unsigned char *haystack, *needle;    chartype b; @@ -109,5 +109,5 @@ foundneedle:  ret0:    return 0;  } - -strong_alias(__strstr,strstr) +libc_hidden_proto(strstr) +libc_hidden_def(strstr) diff --git a/libc/string/generic/strtok_r.c b/libc/string/generic/strtok_r.c index 1a11166dd..3f7ed2c9f 100644 --- a/libc/string/generic/strtok_r.c +++ b/libc/string/generic/strtok_r.c @@ -20,6 +20,10 @@  #define _GNU_SOURCE  #include <string.h> +libc_hidden_proto(strspn) +libc_hidden_proto(strpbrk) +libc_hidden_proto(rawmemchr) +  /* 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: @@ -30,7 +34,7 @@  	x = strtok_r(NULL, "=", &sp);	// x = NULL  		// s = "abc\0-def\0"  */ -char attribute_hidden *__strtok_r (char *s, const char *delim, char **save_ptr) +char *strtok_r (char *s, const char *delim, char **save_ptr)  {    char *token; @@ -38,7 +42,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; @@ -47,10 +51,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.  */ @@ -59,5 +63,5 @@ char attribute_hidden *__strtok_r (char *s, const char *delim, char **save_ptr)      }    return token;  } - -strong_alias(__strtok_r,strtok_r) +libc_hidden_proto(strtok_r) +libc_hidden_def(strtok_r) diff --git a/libc/string/i386/memchr.c b/libc/string/i386/memchr.c index c7cd33758..b2fde07ad 100644 --- a/libc/string/i386/memchr.c +++ b/libc/string/i386/memchr.c @@ -32,7 +32,7 @@  #include <string.h> -void attribute_hidden *__memchr(const void *cs, int c, size_t count) +void *memchr(const void *cs, int c, size_t count)  {      int d0;      register void * __res; @@ -47,5 +47,5 @@ void attribute_hidden *__memchr(const void *cs, int c, size_t count)  	    :"=D" (__res), "=&c" (d0) : "a" (c),"0" (cs),"1" (count));      return __res;  } - -strong_alias(__memchr,memchr) +libc_hidden_proto(memchr) +libc_hidden_def(memchr) diff --git a/libc/string/i386/memcpy.c b/libc/string/i386/memcpy.c index 12ba8d7de..837d7d65b 100644 --- a/libc/string/i386/memcpy.c +++ b/libc/string/i386/memcpy.c @@ -32,7 +32,7 @@  #include <string.h> -void attribute_hidden *__memcpy(void * to, const void * from, size_t n) +void *memcpy(void * to, const void * from, size_t n)  {      int d0, d1, d2;      __asm__ __volatile__( @@ -49,5 +49,5 @@ void attribute_hidden *__memcpy(void * to, const void * from, size_t n)  	    : "memory");      return (to);  } - -strong_alias(__memcpy,memcpy) +libc_hidden_proto(memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/i386/memmove.c b/libc/string/i386/memmove.c index d6e29e553..8122803ef 100644 --- a/libc/string/i386/memmove.c +++ b/libc/string/i386/memmove.c @@ -32,7 +32,7 @@  #include <string.h> -void attribute_hidden *__memmove(void *dest, const void *src, size_t n) +void *memmove(void *dest, const void *src, size_t n)  {      int d0, d1, d2;      if (dest<src) @@ -55,5 +55,5 @@ void attribute_hidden *__memmove(void *dest, const void *src, size_t n)  		:"memory");      return dest;  } - -strong_alias(__memmove,memmove) +libc_hidden_proto(memmove) +libc_hidden_def(memmove) diff --git a/libc/string/i386/memset.c b/libc/string/i386/memset.c index eadbf9feb..bf527619a 100644 --- a/libc/string/i386/memset.c +++ b/libc/string/i386/memset.c @@ -32,7 +32,7 @@  #include <string.h> -void attribute_hidden *__memset(void *s, int c, size_t count) +void *memset(void *s, int c, size_t count)  {      int d0, d1;      __asm__ __volatile__( @@ -43,5 +43,5 @@ void attribute_hidden *__memset(void *s, int c, size_t count)  	    :"memory");      return s;  } - -strong_alias(__memset,memset) +libc_hidden_proto(memset) +libc_hidden_def(memset) diff --git a/libc/string/i386/strcat.c b/libc/string/i386/strcat.c index 02b2a3c5b..5364c9029 100644 --- a/libc/string/i386/strcat.c +++ b/libc/string/i386/strcat.c @@ -32,7 +32,7 @@  #include <string.h> -char attribute_hidden *__strcat(char * dest, const char * src) +char *strcat(char * dest, const char * src)  {      int d0, d1, d2, d3;      __asm__ __volatile__( @@ -47,5 +47,5 @@ char attribute_hidden *__strcat(char * dest, const char * src)  	    : "0" (src), "1" (dest), "2" (0), "3" (0xffffffff):"memory");      return dest;  } - -strong_alias(__strcat,strcat) +libc_hidden_proto(strcat) +libc_hidden_def(strcat) diff --git a/libc/string/i386/strchr.c b/libc/string/i386/strchr.c index a8343fa00..3f1aa7635 100644 --- a/libc/string/i386/strchr.c +++ b/libc/string/i386/strchr.c @@ -32,7 +32,7 @@  #include <string.h> -char attribute_hidden *__strchr(const char *s, int c) +char *strchr(const char *s, int c)  {      int d0;      register char * __res; @@ -49,7 +49,6 @@ char attribute_hidden *__strchr(const char *s, int c)  	    :"=a" (__res), "=&S" (d0) : "1" (s),"0" (c));      return __res;  } - -strong_alias(__strchr,strchr) - -strong_alias(__strchr,index) +libc_hidden_proto(strchr) +libc_hidden_def(strchr) +strong_alias(strchr,index) diff --git a/libc/string/i386/strcmp.c b/libc/string/i386/strcmp.c index f335da646..81cc16c7f 100644 --- a/libc/string/i386/strcmp.c +++ b/libc/string/i386/strcmp.c @@ -32,7 +32,7 @@  #include <string.h> -int attribute_hidden __strcmp(const char *cs, const char *ct) +int strcmp(const char *cs, const char *ct)  {      int d0, d1;      register int __res; @@ -51,10 +51,11 @@ int attribute_hidden __strcmp(const char *cs, const char *ct)  	    :"1" (cs),"2" (ct));      return __res;  } - -strong_alias(__strcmp,strcmp) +libc_hidden_proto(strcmp) +libc_hidden_def(strcmp)  #ifndef __UCLIBC_HAS_LOCALE__ -hidden_strong_alias(__strcmp,__strcoll) -strong_alias(__strcmp,strcoll) +strong_alias(strcmp,strcoll) +libc_hidden_proto(strcoll) +libc_hidden_def(strcoll)  #endif diff --git a/libc/string/i386/strcpy.c b/libc/string/i386/strcpy.c index 59effd45e..361dcdbb9 100644 --- a/libc/string/i386/strcpy.c +++ b/libc/string/i386/strcpy.c @@ -32,7 +32,7 @@  #include <string.h> -char attribute_hidden *__strcpy(char * dest, const char * src) +char *strcpy(char * dest, const char * src)  {      int d0, d1, d2;      __asm__ __volatile__( @@ -44,5 +44,5 @@ char attribute_hidden *__strcpy(char * dest, const char * src)  	    :"0" (src),"1" (dest) : "memory");      return dest;  } - -strong_alias(__strcpy,strcpy) +libc_hidden_proto(strcpy) +libc_hidden_def(strcpy) diff --git a/libc/string/i386/strlen.c b/libc/string/i386/strlen.c index 01cc46f9e..2ef57e3f8 100644 --- a/libc/string/i386/strlen.c +++ b/libc/string/i386/strlen.c @@ -32,7 +32,7 @@  #include <string.h> -size_t attribute_hidden __strlen(const char *s) +size_t strlen(const char *s)  {      int d0;      register int __res; @@ -44,5 +44,5 @@ size_t attribute_hidden __strlen(const char *s)  	    :"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffff));      return __res;  } - -strong_alias(__strlen,strlen) +libc_hidden_proto(strlen) +libc_hidden_def(strlen) diff --git a/libc/string/i386/strncat.c b/libc/string/i386/strncat.c index b55b87b59..4a6dac31e 100644 --- a/libc/string/i386/strncat.c +++ b/libc/string/i386/strncat.c @@ -32,7 +32,7 @@  #include <string.h> -char attribute_hidden *__strncat(char * dest,  +char *strncat(char * dest,   	const char * src, size_t count)  {      int d0, d1, d2, d3; @@ -57,5 +57,5 @@ char attribute_hidden *__strncat(char * dest,  	    : "memory");      return dest;  } - -strong_alias(__strncat,strncat) +libc_hidden_proto(strncat) +libc_hidden_def(strncat) diff --git a/libc/string/i386/strncmp.c b/libc/string/i386/strncmp.c index 2e22bf642..96b966e30 100644 --- a/libc/string/i386/strncmp.c +++ b/libc/string/i386/strncmp.c @@ -32,7 +32,7 @@  #include <string.h> -int attribute_hidden __strncmp(const char *cs, const char *ct, size_t count) +int strncmp(const char *cs, const char *ct, size_t count)  {      register int __res;      int d0, d1, d2; @@ -54,5 +54,5 @@ int attribute_hidden __strncmp(const char *cs, const char *ct, size_t count)  	    :"1" (cs),"2" (ct),"3" (count));      return __res;  } - -strong_alias(__strncmp,strncmp) +libc_hidden_proto(strncmp) +libc_hidden_def(strncmp) diff --git a/libc/string/i386/strncpy.c b/libc/string/i386/strncpy.c index 272c60ee4..dde4d3ee1 100644 --- a/libc/string/i386/strncpy.c +++ b/libc/string/i386/strncpy.c @@ -32,7 +32,7 @@  #include <string.h> -char attribute_hidden *__strncpy(char * dest, const char * src, size_t count) +char *strncpy(char * dest, const char * src, size_t count)  {      int d0, d1, d2, d3;      __asm__ __volatile__( @@ -52,5 +52,5 @@ char attribute_hidden *__strncpy(char * dest, const char * src, size_t count)  	    :"0" (src),"1" (dest),"2" (count) : "memory");      return dest;  } - -strong_alias(__strncpy,strncpy) +libc_hidden_proto(strncpy) +libc_hidden_def(strncpy) diff --git a/libc/string/i386/strnlen.c b/libc/string/i386/strnlen.c index ef5c83a9a..7d9042fa4 100644 --- a/libc/string/i386/strnlen.c +++ b/libc/string/i386/strnlen.c @@ -33,7 +33,7 @@  #define _GNU_SOURCE  #include <string.h> -size_t attribute_hidden __strnlen(const char *s, size_t count) +size_t strnlen(const char *s, size_t count)  {      int d0;      register int __res; @@ -51,5 +51,5 @@ size_t attribute_hidden __strnlen(const char *s, size_t count)  	    :"c" (s),"1" (count));      return __res;  } - -strong_alias(__strnlen,strnlen) +libc_hidden_proto(strnlen) +libc_hidden_def(strnlen) diff --git a/libc/string/i386/strrchr.c b/libc/string/i386/strrchr.c index 9f0f65a36..094f4418e 100644 --- a/libc/string/i386/strrchr.c +++ b/libc/string/i386/strrchr.c @@ -32,7 +32,7 @@  #include <string.h> -char attribute_hidden *__strrchr(const char *s, int c) +char *strrchr(const char *s, int c)  {      int d0, d1;      register char * __res; @@ -47,7 +47,6 @@ char attribute_hidden *__strrchr(const char *s, int c)  	    :"=g" (__res), "=&S" (d0), "=&a" (d1) :"0" (0),"1" (s),"2" (c));      return __res;  } - -strong_alias(__strrchr,strrchr) - -strong_alias(__strrchr,rindex) +libc_hidden_proto(strrchr) +libc_hidden_def(strrchr) +strong_alias(strrchr,rindex) diff --git a/libc/string/memccpy.c b/libc/string/memccpy.c index 81d20b19c..fe5a76a4d 100644 --- a/libc/string/memccpy.c +++ b/libc/string/memccpy.c @@ -9,7 +9,7 @@  #include "_string.h" -void attribute_hidden *__memccpy(void * __restrict s1, const void * __restrict s2, int c, size_t n) +void *memccpy(void * __restrict s1, const void * __restrict s2, int c, size_t n)  {  	register char *r1 = s1;  	register const char *r2 = s2; @@ -18,5 +18,3 @@ void attribute_hidden *__memccpy(void * __restrict s1, const void * __restrict s  	return (n == (size_t) -1) ? NULL : r1;  } - -strong_alias(__memccpy,memccpy) diff --git a/libc/string/memchr.c b/libc/string/memchr.c index 288bd9748..413999722 100644 --- a/libc/string/memchr.c +++ b/libc/string/memchr.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wmemchr __wmemchr  # define Wmemchr wmemchr  #else -# define __Wmemchr __memchr  # define Wmemchr memchr  #endif -Wvoid attribute_hidden *__Wmemchr(const Wvoid *s, Wint c, size_t n) +libc_hidden_proto(Wmemchr) + +Wvoid *Wmemchr(const Wvoid *s, Wint c, size_t n)  {  	register const Wuchar *r = (const Wuchar *) s;  #ifdef __BCC__ @@ -37,4 +37,4 @@ Wvoid attribute_hidden *__Wmemchr(const Wvoid *s, Wint c, size_t n)  }  #undef np -strong_alias(__Wmemchr,Wmemchr) +libc_hidden_def(Wmemchr) diff --git a/libc/string/memcmp.c b/libc/string/memcmp.c index 9808b3785..9de28c234 100644 --- a/libc/string/memcmp.c +++ b/libc/string/memcmp.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wmemcmp __wmemcmp  # define Wmemcmp wmemcmp  #else -# define __Wmemcmp __memcmp +libc_hidden_proto(memcmp)  # define Wmemcmp memcmp  #endif -int attribute_hidden __Wmemcmp(const Wvoid *s1, const Wvoid *s2, size_t n) +int Wmemcmp(const Wvoid *s1, const Wvoid *s2, size_t n)  {  	register const Wuchar *r1 = (const Wuchar *) s1;  	register const Wuchar *r2 = (const Wuchar *) s2; @@ -37,7 +36,7 @@ int attribute_hidden __Wmemcmp(const Wvoid *s1, const Wvoid *s2, size_t n)  #endif  } -strong_alias(__Wmemcmp,Wmemcmp)  #ifndef WANT_WIDE -strong_alias(__memcmp,bcmp) +libc_hidden_def(memcmp) +strong_alias(memcmp,bcmp)  #endif diff --git a/libc/string/memcpy.c b/libc/string/memcpy.c index abfe1b4ef..dc2986778 100644 --- a/libc/string/memcpy.c +++ b/libc/string/memcpy.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wmemcpy __wmemcpy  # define Wmemcpy wmemcpy  #else -# define __Wmemcpy __memcpy  # define Wmemcpy memcpy  #endif -Wvoid attribute_hidden *__Wmemcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n) +libc_hidden_proto(Wmemcpy) + +Wvoid *Wmemcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)  {  	register Wchar *r1 = s1;  	register const Wchar *r2 = s2; @@ -33,5 +33,4 @@ Wvoid attribute_hidden *__Wmemcpy(Wvoid * __restrict s1, const Wvoid * __restric  	return s1;  } - -strong_alias(__Wmemcpy,Wmemcpy) +libc_hidden_def(Wmemcpy) diff --git a/libc/string/memmem.c b/libc/string/memmem.c index a42176181..f57733c4a 100644 --- a/libc/string/memmem.c +++ b/libc/string/memmem.c @@ -7,7 +7,7 @@  #include "_string.h" -void attribute_hidden *__memmem(const void *haystack, size_t haystacklen, +void *memmem(const void *haystack, size_t haystacklen,  		     const void *needle, size_t needlelen)  {  	register const char *ph; @@ -36,5 +36,3 @@ void attribute_hidden *__memmem(const void *haystack, size_t haystacklen,  	return NULL;  } - -strong_alias(__memmem,memmem) diff --git a/libc/string/memmove.c b/libc/string/memmove.c index 9e50cf5a9..3cdcca116 100644 --- a/libc/string/memmove.c +++ b/libc/string/memmove.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wmemmove __wmemmove  # define Wmemmove wmemmove  #else -# define __Wmemmove __memmove +libc_hidden_proto(memmove)  # define Wmemmove memmove  #endif -Wvoid attribute_hidden *__Wmemmove(Wvoid *s1, const Wvoid *s2, size_t n) +Wvoid *Wmemmove(Wvoid *s1, const Wvoid *s2, size_t n)  {  #ifdef __BCC__  	register Wchar *s = (Wchar *) s1; @@ -54,4 +53,6 @@ Wvoid attribute_hidden *__Wmemmove(Wvoid *s1, const Wvoid *s2, size_t n)  #endif  } -strong_alias(__Wmemmove,Wmemmove) +#ifndef WANT_WIDE +libc_hidden_def(Wmemmove) +#endif diff --git a/libc/string/mempcpy.c b/libc/string/mempcpy.c index aed37d03a..70626f24a 100644 --- a/libc/string/mempcpy.c +++ b/libc/string/mempcpy.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wmempcpy __wmempcpy  # define Wmempcpy wmempcpy  #else -# define __Wmempcpy __mempcpy  # define Wmempcpy mempcpy  #endif -Wvoid attribute_hidden *__Wmempcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n) +libc_hidden_proto(Wmempcpy) + +Wvoid *Wmempcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)  {  	register Wchar *r1 = s1;  	register const Wchar *r2 = s2; @@ -34,4 +34,4 @@ Wvoid attribute_hidden *__Wmempcpy(Wvoid * __restrict s1, const Wvoid * __restri  	return r1;  } -strong_alias(__Wmempcpy,Wmempcpy) +libc_hidden_def(Wmempcpy) diff --git a/libc/string/memrchr.c b/libc/string/memrchr.c index fb696bc6d..0bb67b2e5 100644 --- a/libc/string/memrchr.c +++ b/libc/string/memrchr.c @@ -7,7 +7,9 @@  #include "_string.h" -void attribute_hidden *__memrchr(const void *s, int c, size_t n) +libc_hidden_proto(memrchr) + +void *memrchr(const void *s, int c, size_t n)  {  	register const unsigned char *r;  #ifdef __BCC__ @@ -30,4 +32,4 @@ void attribute_hidden *__memrchr(const void *s, int c, size_t n)  }  #undef np -strong_alias(__memrchr,memrchr) +libc_hidden_def(memrchr) diff --git a/libc/string/memset.c b/libc/string/memset.c index cb97dbce8..2f3fc271d 100644 --- a/libc/string/memset.c +++ b/libc/string/memset.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wmemset __wmemset  # define Wmemset wmemset  #else -# define __Wmemset __memset +libc_hidden_proto(memset)  # define Wmemset memset  #endif -Wvoid attribute_hidden *__Wmemset(Wvoid *s, Wint c, size_t n) +Wvoid *Wmemset(Wvoid *s, Wint c, size_t n)  {  	register Wuchar *p = (Wuchar *) s;  #ifdef __BCC__ @@ -34,4 +33,6 @@ Wvoid attribute_hidden *__Wmemset(Wvoid *s, Wint c, size_t n)  }  #undef np -strong_alias(__Wmemset,Wmemset) +#ifndef WANT_WIDE +libc_hidden_def(memset) +#endif diff --git a/libc/string/mips/memcpy.S b/libc/string/mips/memcpy.S index 2e42b1793..155bc1128 100644 --- a/libc/string/mips/memcpy.S +++ b/libc/string/mips/memcpy.S @@ -40,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? @@ -137,6 +137,6 @@ L(shfth):  	move	a2, t0  	.set	reorder -END (__memcpy) +END (memcpy) -strong_alias(__memcpy,memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/mips/memset.S b/libc/string/mips/memset.S index 4269ebc6e..9169ad58a 100644 --- a/libc/string/mips/memset.S +++ b/libc/string/mips/memset.S @@ -34,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? @@ -87,6 +87,6 @@ L(exit):  	nop  	.set	reorder -END (__memset) +END (memset) -strong_alias(__memset,memset) +libc_hidden_def(memset) diff --git a/libc/string/mips/sysdep.h b/libc/string/mips/sysdep.h index 27518ac42..96f088c94 100644 --- a/libc/string/mips/sysdep.h +++ b/libc/string/mips/sysdep.h @@ -27,7 +27,6 @@  #define ENTRY(name) \    .globl name;                                                                \ -  .hidden name;                                                               \    .align 2;                                                                   \    .ent name,0;                                                                \    name##: diff --git a/libc/string/powerpc/memcpy.c b/libc/string/powerpc/memcpy.c index 5af96869b..8ed03e526 100644 --- a/libc/string/powerpc/memcpy.c +++ b/libc/string/powerpc/memcpy.c @@ -21,7 +21,7 @@  #include <string.h> -void attribute_hidden *__memcpy(void *to, const void *from, size_t n) +void *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++. */  { @@ -76,5 +76,5 @@ void attribute_hidden *__memcpy(void *to, const void *from, size_t n)  		goto copy_chunks;  	goto lessthan8;  } - -strong_alias(__memcpy,memcpy) +libc_hidden_proto(memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/powerpc/memmove.c b/libc/string/powerpc/memmove.c index 1d513a966..10e46867c 100644 --- a/libc/string/powerpc/memmove.c +++ b/libc/string/powerpc/memmove.c @@ -21,7 +21,7 @@  #include <string.h> -void attribute_hidden *__memmove(void *to, const void *from, size_t n) +void *memmove(void *to, const void *from, size_t n)  {  	unsigned long rem, chunks, tmp1, tmp2;  	unsigned char *tmp_to; @@ -72,5 +72,5 @@ void attribute_hidden *__memmove(void *to, const void *from, size_t n)  		goto copy_chunks;  	goto lessthan8;  } - -strong_alias(__memmove,memmove) +libc_hidden_proto(memmove) +libc_hidden_def(memmove) diff --git a/libc/string/powerpc/memset.c b/libc/string/powerpc/memset.c index f6cda9579..47df2b607 100644 --- a/libc/string/powerpc/memset.c +++ b/libc/string/powerpc/memset.c @@ -32,7 +32,7 @@ static inline int expand_byte_word(int c){  	return c;  } -void attribute_hidden *__memset(void *to, int c, size_t n) +void *memset(void *to, int c, size_t n)  {  	unsigned long rem, chunks;  	unsigned char *tmp_to; @@ -78,5 +78,5 @@ void attribute_hidden *__memset(void *to, int c, size_t n)  		goto copy_chunks;  	goto lessthan8;  } - -strong_alias(__memset,memset) +libc_hidden_proto(memset) +libc_hidden_def(memset) diff --git a/libc/string/psignal.c b/libc/string/psignal.c index b6d6a30c0..daf9764b1 100644 --- a/libc/string/psignal.c +++ b/libc/string/psignal.c @@ -5,11 +5,13 @@   * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.   */ +#define _GNU_SOURCE  #include <features.h>  #include <stdio.h>  #include <string.h> -extern char *__strsignal (int __sig) __THROW attribute_hidden; +libc_hidden_proto(fprintf) +libc_hidden_proto(strsignal)  /* TODO: make this threadsafe with a reentrant version of strsignal? */ @@ -26,5 +28,5 @@ void psignal(int signum, register const char *message)  		message = (sep += 2);	/* or passed an empty string. */  	} -	fprintf(stderr, "%s%s%s\n", message, sep, __strsignal(signum)); +	fprintf(stderr, "%s%s%s\n", message, sep, strsignal(signum));  } diff --git a/libc/string/rawmemchr.c b/libc/string/rawmemchr.c index 81d578a0f..754a34e18 100644 --- a/libc/string/rawmemchr.c +++ b/libc/string/rawmemchr.c @@ -7,7 +7,9 @@  #include "_string.h" -void attribute_hidden *__rawmemchr(const void *s, int c) +libc_hidden_proto(rawmemchr) + +void *rawmemchr(const void *s, int c)  {  	register const unsigned char *r = s; @@ -15,5 +17,4 @@ void attribute_hidden *__rawmemchr(const void *s, int c)  	return (void *) r;	/* silence the warning */  } - -strong_alias(__rawmemchr,rawmemchr) +libc_hidden_def(rawmemchr) diff --git a/libc/string/sh64/memcpy.S b/libc/string/sh64/memcpy.S index d74980613..3c0ea0c0d 100644 --- a/libc/string/sh64/memcpy.S +++ b/libc/string/sh64/memcpy.S @@ -39,12 +39,11 @@  #include <features.h>  	.section .text..SHmedia32,"ax" -	.globl	__memcpy -	.hidden	__memcpy -	.type	__memcpy, @function +	.globl	memcpy +	.type	memcpy, @function  	.align	5 -__memcpy: +memcpy:  #define LDUAQ(P,O,D0,D1) ldlo.q P,O,D0; ldhi.q P,O+7,D1  #define STUAQ(P,O,D0,D1) stlo.q P,O,D0; sthi.q P,O+7,D1 @@ -201,6 +200,6 @@ Loop_ua:  	stlo.q r5, 8, r1  	blink tr1, r63 -	.size __memcpy,.-__memcpy +	.size memcpy,.-memcpy -strong_alias(__memcpy,memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/sh64/memset.S b/libc/string/sh64/memset.S index cd2ad7998..f588323f0 100644 --- a/libc/string/sh64/memset.S +++ b/libc/string/sh64/memset.S @@ -21,13 +21,12 @@  #endif  	.section .text..SHmedia32,"ax" -	.globl	__memset -	.hidden	__memset -	.type	__memset, @function +	.globl	memset +	.type	memset, @function  	.align 5 -__memset: +memset:  	pta/l multiquad, tr0  	andi r2, 7, r22  	ptabs r18, tr2 @@ -92,6 +91,6 @@ loop:  	sthi.q r5, -1, r3  	blink tr2,r63 -	.size	__memset,.-__memset +	.size	memset,.-memset -strong_alias(__memset,memset) +libc_hidden_def(memset) diff --git a/libc/string/sh64/strcpy.S b/libc/string/sh64/strcpy.S index 2ce998257..da79d5143 100644 --- a/libc/string/sh64/strcpy.S +++ b/libc/string/sh64/strcpy.S @@ -18,12 +18,11 @@  #endif  	.section .text..SHmedia32,"ax" -	.globl	__strcpy -	.hidden	__strcpy -	.type	__strcpy, @function +	.globl	strcpy +	.type	strcpy, @function  	.align 5 -__strcpy: +strcpy:  	pta/l shortstring,tr1  	ldlo.q r3,0,r4 @@ -98,6 +97,6 @@ loop:  	addi r0, 8, r0  	blink tr1, r63 // shortstring -	.size	__strcpy,.-__strcpy +	.size	strcpy,.-strcpy -strong_alias(__strcpy,strcpy) +libc_hidden_def(strcpy) diff --git a/libc/string/sh64/strlen.S b/libc/string/sh64/strlen.S index 673a34dbd..18f4164ff 100644 --- a/libc/string/sh64/strlen.S +++ b/libc/string/sh64/strlen.S @@ -33,12 +33,11 @@  #include <features.h>  	.section .text..SHmedia32,"ax" -	.globl	__strlen -	.hidden	__strlen -	.type	__strlen,@function +	.globl	strlen +	.type	strlen,@function  	.balign 16 -__strlen: +strlen:  	ptabs	r18, tr4  	/* @@ -59,6 +58,6 @@ loop:  	or	r0, r63, r2  	blink	tr4, r63 -	.size	__strlen,.-__strlen +	.size	strlen,.-strlen -strong_alias(__strlen,strlen) +libc_hidden_def(strlen) diff --git a/libc/string/sparc/_glibc_inc.h b/libc/string/sparc/_glibc_inc.h index 6ef1dbde6..4eb4d755c 100644 --- a/libc/string/sparc/_glibc_inc.h +++ b/libc/string/sparc/_glibc_inc.h @@ -14,7 +14,6 @@  #define ENTRY(sym) \  	.global sym; \ -	.hidden sym; \  	.align  ENTRY_ALIGN; \  	.type   sym,%function; \  	sym: diff --git a/libc/string/sparc/sparc32/memchr.S b/libc/string/sparc/sparc32/memchr.S index e012844ba..4d57a553b 100644 --- a/libc/string/sparc/sparc32/memchr.S +++ b/libc/string/sparc/sparc32/memchr.S @@ -63,7 +63,7 @@  1:	retl  	 sub		%o0, 1, %o0 -ENTRY(__memchr) +ENTRY(memchr)  	andcc		%o1, 0xff, %o1  	sll		%o1, 8, %g6  	andcc		%o0, 3, %g0 @@ -136,9 +136,9 @@ ENTRY(__memchr)  	 sub		%o0, 3, %o0  4:	retl  	 sub		%o0, 4, %o0 -END(__memchr) -strong_alias(__memchr,memchr) +END(memchr) +libc_hidden_def(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 a1dd246e6..3f40d7822 100644 --- a/libc/string/sparc/sparc32/memcpy.S +++ b/libc/string/sparc/sparc32/memcpy.S @@ -161,14 +161,14 @@  	b		3f  	 sub		%o0, 2, %o0 -ENTRY(__bcopy) +ENTRY(bcopy)  	mov		%o0, %o3  	mov		%o1, %o0  	mov		%o3, %o1 -END(__bcopy) -strong_alias(__bcopy,bcopy) +END(bcopy) +libc_hidden_def(bcopy) -ENTRY(__memmove) +ENTRY(memmove)  	cmp		%o0, %o1  	st		%o0, [%sp + 64]  	bleu		9f @@ -448,10 +448,10 @@ ENTRY(__memmove)  	sub		%o2, 2, %o2  	b		3f  	 add		%o0, 2, %o0 -END(__memmove) -strong_alias(__memmove,memmove) +END(memmove) +libc_hidden_def(memmove) -ENTRY(__memcpy)		/* %o0=dst %o1=src %o2=len */ +ENTRY(memcpy)		/* %o0=dst %o1=src %o2=len */  	sub		%o0, %o1, %o4  	st		%o0, [%sp + 64]  9:	andcc		%o4, 3, %o5 @@ -966,5 +966,5 @@ ENTRY(__memcpy)		/* %o0=dst %o1=src %o2=len */  	 sub		%o7, %o4, %o5  110:	retl  	 sub		%o7, %g6, %o5 -END(__memcpy) -strong_alias(__memcpy,memcpy) +END(memcpy) +libc_hidden_def(memcpy) diff --git a/libc/string/sparc/sparc32/memset.S b/libc/string/sparc/sparc32/memset.S index b60b881be..41e172cd8 100644 --- a/libc/string/sparc/sparc32/memset.S +++ b/libc/string/sparc/sparc32/memset.S @@ -43,7 +43,7 @@  	.text  	.align 4 -ENTRY(__bzero) +ENTRY(bzero)  	b		1f  	 mov		%g0, %g3 @@ -60,10 +60,10 @@ ENTRY(__bzero)  	add		%o1, %o2, %o1  	b		4f  	 sub		%o0, %o2, %o0 -END(__bzero) -strong_alias(__bzero,bzero) +END(bzero) +libc_hidden_def(bzero) -ENTRY(__memset) +ENTRY(memset)  	and		%o1, 0xff, %g3  	sll		%g3, 8, %g2  	or		%g3, %g2, %g3 @@ -148,5 +148,5 @@ ENTRY(__memset)  	stb		%g3, [%o0 + 6]  0:	retl  	 nop -END(__memset) -strong_alias(__memset,memset) +END(memset) +libc_hidden_def(memset) diff --git a/libc/string/sparc/sparc32/stpcpy.S b/libc/string/sparc/sparc32/stpcpy.S index 26d2fecbd..daf116eb1 100644 --- a/libc/string/sparc/sparc32/stpcpy.S +++ b/libc/string/sparc/sparc32/stpcpy.S @@ -65,7 +65,7 @@  1:	retl  	 add		%o0, -1, %o0 -ENTRY(__stpcpy) +ENTRY(stpcpy)  	andcc		%o1, 3, %g0  	bne		10b  	 sethi		%hi(0x80808080), %o4 @@ -156,6 +156,6 @@ ENTRY(__stpcpy)  	 add		%o0, 1, %o0  19:	retl  	 nop -END(__stpcpy) +END(stpcpy) -strong_alias(__stpcpy,stpcpy) +libc_hidden_def(stpcpy) diff --git a/libc/string/sparc/sparc32/strcat.S b/libc/string/sparc/sparc32/strcat.S index 2ee630b23..eda029a16 100644 --- a/libc/string/sparc/sparc32/strcat.S +++ b/libc/string/sparc/sparc32/strcat.S @@ -91,7 +91,7 @@  	b		3f  	 sub		%o0, 1, %o0 -ENTRY(__strcat) +ENTRY(strcat)  	mov		%o0, %g2  	andcc		%o0, 3, %g0  	bne		11b @@ -343,6 +343,6 @@ ENTRY(__strcat)  	 srl		%o5, 16, %o4  	retl  	 mov		%g2, %o0 -END(__strcat) +END(strcat) -strong_alias(__strcat,strcat) +libc_hidden_def(strcat) diff --git a/libc/string/sparc/sparc32/strchr.S b/libc/string/sparc/sparc32/strchr.S index 69360c53a..d06bbe3cc 100644 --- a/libc/string/sparc/sparc32/strchr.S +++ b/libc/string/sparc/sparc32/strchr.S @@ -67,7 +67,7 @@  1:	retl  	 sub		%o0, 1, %o0 -ENTRY(__strchr) +ENTRY(strchr)  	andcc		%o1, 0xff, %o1  	be		12f  	 sll		%o1, 8, %o2 @@ -215,11 +215,11 @@ ENTRY(__strchr)  1:	 or		%o4, %lo(0x01010101), %o2  	b		7f  	 ld		[%o0], %g4 -END(__strchr) -strong_alias(__strchr,strchr) -strong_alias(__strchr,index) +END(strchr) +libc_hidden_def(strchr) +strong_alias(strchr,index) -ENTRY(__strrchr) +ENTRY(strrchr)  	andcc		%o1, 0xff, %o1  	clr		%o5  	be		12b @@ -276,6 +276,6 @@ ENTRY(__strrchr)  	 ld		[%o0], %g4  9:	retl  	 mov		%o5, %o0 -END(__strrchr) -strong_alias(__strrchr,strrchr) -strong_alias(__strrchr,rindex) +END(strrchr) +libc_hidden_def(strrchr) +strong_alias(strrchr,rindex) diff --git a/libc/string/sparc/sparc32/strcmp.S b/libc/string/sparc/sparc32/strcmp.S index 6a807e08a..d43883de6 100644 --- a/libc/string/sparc/sparc32/strcmp.S +++ b/libc/string/sparc/sparc32/strcmp.S @@ -74,7 +74,7 @@  2:	retl  	 mov		%o4, %o0 -ENTRY(__strcmp) +ENTRY(strcmp)  	andcc		%o0, 3, %g0  	bne		10b  	 sethi		%hi(0x80808080), %g1 @@ -252,6 +252,5 @@ ENTRY(__strcmp)  	 ld		[%i0], %i4  	jmpl		%i7 + 8, %g0  	 restore	%g4, %g0, %o0 -END(__strcmp) - -strong_alias(__strcmp,strcmp) +END(strcmp) +libc_hidden_def(strcmp) diff --git a/libc/string/sparc/sparc32/strcpy.S b/libc/string/sparc/sparc32/strcpy.S index ab57e00a5..4d7742ebc 100644 --- a/libc/string/sparc/sparc32/strcpy.S +++ b/libc/string/sparc/sparc32/strcpy.S @@ -63,7 +63,7 @@  	b		6f  	 andcc		%o0, 3, %g3 -ENTRY(__strcpy) +ENTRY(strcpy)  	mov		%o0, %g2  	andcc		%o1, 3, %g0  	bne		1b @@ -269,6 +269,5 @@ ENTRY(__strcpy)  	 srl		%o5, 16, %o4  	retl  	 mov		%g2, %o0 -END(__strcpy) - -strong_alias(__strcpy,strcpy) +END(strcpy) +libc_hidden_def(strcpy) diff --git a/libc/string/sparc/sparc32/strlen.S b/libc/string/sparc/sparc32/strlen.S index 81beb7f62..4edfe7e78 100644 --- a/libc/string/sparc/sparc32/strlen.S +++ b/libc/string/sparc/sparc32/strlen.S @@ -63,7 +63,7 @@  3:	retl  	 mov		2, %o0 -ENTRY(__strlen) +ENTRY(strlen)  	mov		%o0, %o1  	andcc		%o0, 3, %g0  	bne		10b @@ -98,6 +98,5 @@ ENTRY(__strlen)  	add		%o4, 1, %o4  13:	retl  	 sub		%o4, %o1, %o0 -END(__strlen) - -strong_alias(__strlen,strlen) +END(strlen) +libc_hidden_def(strlen) diff --git a/libc/string/sparc/sparc64/memchr.S b/libc/string/sparc/sparc64/memchr.S index 7017b5540..6096cc218 100644 --- a/libc/string/sparc/sparc64/memchr.S +++ b/libc/string/sparc/sparc64/memchr.S @@ -54,7 +54,7 @@  	.text  	.align		32 -ENTRY(__memchr) +ENTRY(memchr)  	and		%o1, 0xff, %o1			/* IEU0		Group		*/  #ifdef USE_BPR  	brz,pn		%o2, 12f			/* CTI+IEU1			*/ @@ -253,9 +253,9 @@ ENTRY(__memchr)  23:	retl						/* CTI+IEU1	Group		*/  	 add		%o0, -1, %o0			/* IEU0				*/ -END(__memchr) +END(memchr) -strong_alias(__memchr,memchr) +libc_hidden_def(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 4201b5ec2..4246b3564 100644 --- a/libc/string/sparc/sparc64/memcpy.S +++ b/libc/string/sparc/sparc64/memcpy.S @@ -191,7 +191,7 @@  	.text  	.align		32 -ENTRY(__bcopy) +ENTRY(bcopy)  	sub		%o1, %o0, %o4			/* IEU0		Group		*/  	mov		%o0, %g3			/* IEU1				*/  	cmp		%o4, %o2			/* IEU1		Group		*/ @@ -205,8 +205,8 @@ ENTRY(__bcopy)  	 add		%o0, %o2, %o0			/* IEU0				*/  	retl  	 nop -END(__bcopy) -strong_alias(__bcopy,bcopy) +END(bcopy) +libc_hidden_def(bcopy)  	.align		32  200:	be,pt		%xcc, 201f			/* CTI				*/ @@ -504,7 +504,7 @@ END(__align_cpy_16)  #endif  	.align		32 -ENTRY(__memcpy) +ENTRY(memcpy)  210:  #ifndef USE_BPR  	srl		%o2, 0, %o2			/* IEU1		Group		*/ @@ -695,8 +695,8 @@ ENTRY(__memcpy)  214:	wr		%g0, FPRS_FEF, %fprs  	retl  	 mov		%g4, %o0 -END(__memcpy) -strong_alias(__memcpy,memcpy) +END(memcpy) +libc_hidden_def(memcpy)  	.align		32  228:	andcc		%o2, 1, %g0			/* IEU1		Group		*/ @@ -721,7 +721,7 @@ strong_alias(__memcpy,memcpy)  	 nop  	.align		32 -ENTRY(__memmove) +ENTRY(memmove)  #ifndef USE_BPR  	srl		%o2, 0, %o2			/* IEU1		Group		*/  #endif @@ -912,10 +912,10 @@ ENTRY(__memmove)  234:	wr		%g0, FPRS_FEF, %fprs  	retl  	 mov		%g4, %o0 -END(__memmove) -strong_alias(__memmove,memmove) +END(memmove) +libc_hidden_def(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 6fb25d211..6238f0f97 100644 --- a/libc/string/sparc/sparc64/memset.S +++ b/libc/string/sparc/sparc64/memset.S @@ -36,7 +36,7 @@  	/* Well, memset is a lot easier to get right than bcopy... */  	.text  	.align		32 -ENTRY(__memset) +ENTRY(memset)  	andcc		%o1, 0xff, %o1  	mov		%o0, %o5  	be,a,pt		%icc, 50f @@ -176,8 +176,8 @@ ENTRY(__memset)  	 nop  	ba,pt		%xcc, 18b  	 ldd		[%o0], %f0 -END(__memset) -strong_alias(__memset,memset) +END(memset) +libc_hidden_def(memset)  #define ZERO_BLOCKS(base, offset, source)		\  	stx		source, [base - offset - 0x38];	\ @@ -191,7 +191,7 @@ strong_alias(__memset,memset)  	.text  	.align		32 -ENTRY(__bzero) +ENTRY(bzero)  #ifndef USE_BPR  	srl		%o1, 0, %o1  #endif @@ -309,5 +309,5 @@ ENTRY(__bzero)  	 stb		%g0, [%o0 - 1]  0:	retl  	 mov		%o5, %o0 -END(__bzero) -strong_alias(__bzero,bzero) +END(bzero) +libc_hidden_def(bzero) diff --git a/libc/string/sparc/sparc64/sparcv9b/memcpy.S b/libc/string/sparc/sparc64/sparcv9b/memcpy.S index dd381c7ef..6bfe839ea 100644 --- a/libc/string/sparc/sparc64/sparcv9b/memcpy.S +++ b/libc/string/sparc/sparc64/sparcv9b/memcpy.S @@ -36,7 +36,7 @@  	.text  	.align	32 -ENTRY(__bcopy) +ENTRY(bcopy)  	sub		%o1, %o0, %o4  	mov		%o0, %g4  	cmp		%o4, %o2 @@ -50,8 +50,8 @@ ENTRY(__bcopy)  	 add		%o0, %o2, %o0  	retl  	 nop -END(__bcopy) -strong_alias(__bcopy,bcopy) +END(bcopy) +libc_hidden_def(bcopy)  	/* Special/non-trivial issues of this code:  	 * @@ -68,7 +68,7 @@ strong_alias(__bcopy,bcopy)  	 * of up to 2.4GB per second.  	 */  	.align		32 -ENTRY(__memcpy) +ENTRY(memcpy)  100: /* %o0=dst, %o1=src, %o2=len */  	mov		%o0, %g5 @@ -329,8 +329,8 @@ small_copy_unaligned:  	retl  	 mov		%g5, %o0 -END(__memcpy) -strong_alias(__memcpy,memcpy) +END(memcpy) +libc_hidden_def(memcpy)  #define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3)	\  	ldx		[%src - offset - 0x20], %t0; 		\ @@ -405,7 +405,7 @@ strong_alias(__memcpy,memcpy)  	 mov		%g4, %o0  	.align		32 -ENTRY(__memmove) +ENTRY(memmove)  	mov		%o0, %g5  #ifndef USE_BPR  	srl		%o2, 0, %o2			/* IEU1		Group		*/ @@ -597,8 +597,8 @@ ENTRY(__memmove)  234:	wr		%g0, FPRS_FEF, %fprs  	retl  	 mov		%g4, %o0 -END(__memmove) -strong_alias(__memmove,memmove) +END(memmove) +libc_hidden_def(memmove)  #ifdef USE_BPR  weak_alias(memcpy,__align_cpy_1) diff --git a/libc/string/sparc/sparc64/stpcpy.S b/libc/string/sparc/sparc64/stpcpy.S index 6bd24cfee..8c26c6bec 100644 --- a/libc/string/sparc/sparc64/stpcpy.S +++ b/libc/string/sparc/sparc64/stpcpy.S @@ -45,7 +45,7 @@  	.text  	.align		32 -ENTRY(__stpcpy) +ENTRY(stpcpy)  	sethi		%hi(0x01010101), %g1		/* IEU0		Group		*/  	or		%g1, %lo(0x01010101), %g1	/* IEU0		Group		*/  	andcc		%o0, 7, %g0			/* IEU1				*/ @@ -267,6 +267,5 @@ ENTRY(__stpcpy)  	retl						/* CTI+IEU1	Group		*/  	 mov		%g6, %o0			/* IEU0				*/ -END(__stpcpy) - -strong_alias(__stpcpy,stpcpy) +END(stpcpy) +libc_hidden_def(stpcpy) diff --git a/libc/string/sparc/sparc64/strcat.S b/libc/string/sparc/sparc64/strcat.S index fb3ad2d12..fcc4ba59c 100644 --- a/libc/string/sparc/sparc64/strcat.S +++ b/libc/string/sparc/sparc64/strcat.S @@ -47,7 +47,7 @@  	.text  	.align		32 -ENTRY(__strcat) +ENTRY(strcat)  	sethi		%hi(0x01010101), %g1		/* IEU0		Group		*/  	ldub		[%o0], %o3			/* Load				*/  	or		%g1, %lo(0x01010101), %g1	/* IEU0		Group		*/ @@ -335,6 +335,5 @@ ENTRY(__strcat)  	stb		%o4, [%o0 - 8]			/* Store			*/  	retl						/* CTI+IEU1	Group		*/  	 mov		%g6, %o0			/* IEU0				*/ -END(__strcat) - -strong_alias(__strcat,strcat) +END(strcat) +libc_hidden_def(strcat) diff --git a/libc/string/sparc/sparc64/strchr.S b/libc/string/sparc/sparc64/strchr.S index 34c30df31..6a371352a 100644 --- a/libc/string/sparc/sparc64/strchr.S +++ b/libc/string/sparc/sparc64/strchr.S @@ -47,7 +47,7 @@  	.text  	.align		32 -ENTRY(__strchr) +ENTRY(strchr)  	andcc		%o1, 0xff, %o1			/* IEU1		Group		*/  	be,pn		%icc, 17f			/* CTI				*/  	 sllx		%o1, 8, %g3			/* IEU0		Group		*/ @@ -327,12 +327,12 @@ ENTRY(__strchr)  	 lduba		[%o0] ASI_PNF, %o3		/* Load				*/  	retl						/* CTI+IEU1	Group		*/  	 add		%o0, -1, %o0			/* IEU0				*/ -END(__strchr) -strong_alias(__strchr,strchr) -strong_alias(__strchr,index) +END(strchr) +libc_hidden_def(strchr) +strong_alias(strchr,index)  	.align		32 -ENTRY(__strrchr) +ENTRY(strrchr)  	andcc		%o1, 0xff, %o1			/* IEU1		Group		*/  	be,pn		%icc, 17b			/* CTI				*/  	 clr		%g4				/* IEU0				*/ @@ -476,6 +476,6 @@ ENTRY(__strrchr)  	ba,pt		%xcc, 1b			/* CTI		Group		*/  	 ldx		[%o0], %o3			/* Load				*/ -END(__strrchr) -strong_alias(__strrchr,strrchr) -strong_alias(__strrchr,rindex) +END(strrchr) +libc_hidden_def(strrchr) +strong_alias(strrchr,rindex) diff --git a/libc/string/sparc/sparc64/strcmp.S b/libc/string/sparc/sparc64/strcmp.S index 0e078e9ac..df9e69179 100644 --- a/libc/string/sparc/sparc64/strcmp.S +++ b/libc/string/sparc/sparc64/strcmp.S @@ -45,7 +45,7 @@  	.text  	.align		32 -ENTRY(__strcmp) +ENTRY(strcmp)  	sethi		%hi(0x01010101), %g1			/* IEU0		Group		*/  	andcc		%o0, 7, %g0				/* IEU1				*/  	bne,pn		%icc, 7f				/* CTI				*/ @@ -275,6 +275,5 @@ ENTRY(__strcmp)  	ba,pt		%xcc, 11b				/* CTI		Group		*/  	 ldxa		[%o1 + %o0] ASI_PNF, %g6		/* Load				*/ -END(__strcmp) - -strong_alias(__strcmp,strcmp) +END(strcmp) +libc_hidden_def(strcmp) diff --git a/libc/string/sparc/sparc64/strcpy.S b/libc/string/sparc/sparc64/strcpy.S index d9dff104a..1317d5489 100644 --- a/libc/string/sparc/sparc64/strcpy.S +++ b/libc/string/sparc/sparc64/strcpy.S @@ -45,7 +45,7 @@  	.text  	.align		32 -ENTRY(__strcpy) +ENTRY(strcpy)  	sethi		%hi(0x01010101), %g1		/* IEU0		Group		*/  	mov		%o0, %g6			/* IEU1				*/  	or		%g1, %lo(0x01010101), %g1	/* IEU0		Group		*/ @@ -240,6 +240,6 @@ ENTRY(__strcpy)  	stb		%o4, [%o0 - 8]			/* Store			*/  	retl						/* CTI+IEU1	Group		*/  	 mov		%g6, %o0			/* IEU0				*/ -END(__strcpy) +END(strcpy) -strong_alias(__strcpy,strcpy) +libc_hidden_def(strcpy) diff --git a/libc/string/sparc/sparc64/strlen.S b/libc/string/sparc/sparc64/strlen.S index 3c1cfc0d8..1fe854961 100644 --- a/libc/string/sparc/sparc64/strlen.S +++ b/libc/string/sparc/sparc64/strlen.S @@ -39,7 +39,7 @@  	.text  	.align		32 -ENTRY(__strlen) +ENTRY(strlen)  	sethi		%hi(0x01010101), %g1		/* IEU0		Group		*/  	ldub		[%o0], %o3			/* Load				*/  	or		%g1, %lo(0x01010101), %g1	/* IEU0		Group		*/ @@ -169,6 +169,5 @@ ENTRY(__strlen)  	add		%o0, -1, %o0			/* IEU0		Group		*/  	retl						/* CTI+IEU1	Group		*/  	 sub		%o0, %o1, %o0			/* IEU0				*/ -END(__strlen) - -strong_alias(__strlen,strlen) +END(strlen) +libc_hidden_def(strlen) diff --git a/libc/string/stpcpy.c b/libc/string/stpcpy.c index 540d04831..f34b9f65a 100644 --- a/libc/string/stpcpy.c +++ b/libc/string/stpcpy.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstpcpy __wcpcpy  # define Wstpcpy wcpcpy  #else -# define __Wstpcpy __stpcpy +libc_hidden_proto(stpcpy)  # define Wstpcpy stpcpy  #endif -Wchar attribute_hidden *__Wstpcpy(register Wchar * __restrict s1, const Wchar * __restrict s2) +Wchar *Wstpcpy(register Wchar * __restrict s1, const Wchar * __restrict s2)  {  #ifdef __BCC__  	do { @@ -28,4 +27,6 @@ Wchar attribute_hidden *__Wstpcpy(register Wchar * __restrict s1, const Wchar *  	return s1 - 1;  } -strong_alias(__Wstpcpy,Wstpcpy) +#ifndef WANT_WIDE +libc_hidden_def(stpcpy) +#endif diff --git a/libc/string/stpncpy.c b/libc/string/stpncpy.c index 5b45d0ef9..2603d2bd0 100644 --- a/libc/string/stpncpy.c +++ b/libc/string/stpncpy.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstpncpy __wcpncpy  # define Wstpncpy wcpncpy  #else -# define __Wstpncpy __stpncpy +libc_hidden_proto(stpncpy)  # define Wstpncpy stpncpy  #endif -Wchar attribute_hidden *__Wstpncpy(register Wchar * __restrict s1, +Wchar *Wstpncpy(register Wchar * __restrict s1,  				register const Wchar * __restrict s2,  				size_t n)  { @@ -38,4 +37,6 @@ Wchar attribute_hidden *__Wstpncpy(register Wchar * __restrict s1,  #endif  } -strong_alias(__Wstpncpy,Wstpncpy) +#ifndef WANT_WIDE +libc_hidden_def(stpncpy) +#endif diff --git a/libc/string/strcasecmp.c b/libc/string/strcasecmp.c index 1d758e2ca..42d7230ae 100644 --- a/libc/string/strcasecmp.c +++ b/libc/string/strcasecmp.c @@ -9,44 +9,40 @@  #include <ctype.h>  #include <locale.h> -#ifdef __UCLIBC_HAS_XLOCALE__ -extern int __strcasecmp_l (__const char *__s1, __const char *__s2, -			 __locale_t __loc) -     __THROW __attribute_pure__ __nonnull ((1, 2, 3)) attribute_hidden; -extern int __wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2, -			 __locale_t __loc) __THROW attribute_hidden; -#endif -  #ifdef WANT_WIDE  # define strcasecmp wcscasecmp -# define __strcasecmp __wcscasecmp  # define strcasecmp_l wcscasecmp_l -# define __strcasecmp_l __wcscasecmp_l  # ifdef __UCLIBC_DO_XLOCALE -#  define TOLOWER(C) __towlower_l((C), locale_arg) -extern wint_t __towlower_l (wint_t __wc, __locale_t __locale) __THROW attribute_hidden; +libc_hidden_proto(towlower_l) +#  define TOLOWER(C) towlower_l((C), locale_arg)  # else -#  define TOLOWER(C) __towlower((C)) +libc_hidden_proto(towlower) +#  define TOLOWER(C) towlower((C))  # endif  #else  # ifdef __UCLIBC_DO_XLOCALE -#  define TOLOWER(C) __tolower_l((C), locale_arg) +libc_hidden_proto(tolower_l) +#  define TOLOWER(C) tolower_l((C), locale_arg)  # else -#  define TOLOWER(C) __tolower((C)) +libc_hidden_proto(tolower) +#  define TOLOWER(C) tolower((C))  # endif  #endif  #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -int attribute_hidden __strcasecmp(register const Wchar *s1, register const Wchar *s2) +libc_hidden_proto(strcasecmp_l) + +int strcasecmp(register const Wchar *s1, register const Wchar *s2)  { -	return __strcasecmp_l(s1, s2, __UCLIBC_CURLOCALE); +	return strcasecmp_l(s1, s2, __UCLIBC_CURLOCALE);  } -strong_alias(__strcasecmp,strcasecmp) +libc_hidden_proto(strcasecmp) +libc_hidden_def(strcasecmp)  #else  /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ -int attribute_hidden __UCXL(strcasecmp)(register const Wchar *s1, register const Wchar *s2 +int __XL_NPP(strcasecmp)(register const Wchar *s1, register const Wchar *s2  					  __LOCALE_PARAM )  {  #ifdef WANT_WIDE @@ -70,6 +66,7 @@ int attribute_hidden __UCXL(strcasecmp)(register const Wchar *s1, register const  	return r;  #endif  } -__UCXL_ALIAS(strcasecmp) +libc_hidden_proto(__XL_NPP(strcasecmp)) +libc_hidden_def(__XL_NPP(strcasecmp))  #endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ diff --git a/libc/string/strcasestr.c b/libc/string/strcasestr.c index 5222eda71..d835440ec 100644 --- a/libc/string/strcasestr.c +++ b/libc/string/strcasestr.c @@ -8,7 +8,9 @@  #include "_string.h"  #include <ctype.h> -char attribute_hidden *__strcasestr(const char *s1, const char *s2) +libc_hidden_proto(tolower) + +char *strcasestr(const char *s1, const char *s2)  {  	register const char *s = s1;  	register const char *p = s2; @@ -19,7 +21,7 @@ char attribute_hidden *__strcasestr(const char *s1, const char *s2)  			return (char *) s1;;  		}  		if ((*p == *s) -			|| (__tolower(*((unsigned char *)p)) == __tolower(*((unsigned char *)s))) +			|| (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s)))  			) {  			++p;  			++s; @@ -34,7 +36,7 @@ char attribute_hidden *__strcasestr(const char *s1, const char *s2)  #else  	while (*p && *s) {  		if ((*p == *s) -			|| (__tolower(*((unsigned char *)p)) == __tolower(*((unsigned char *)s))) +			|| (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s)))  			) {  			++p;  			++s; @@ -47,5 +49,3 @@ char attribute_hidden *__strcasestr(const char *s1, const char *s2)  	return (*p) ? NULL : (char *) s1;  #endif  } - -strong_alias(__strcasestr,strcasestr) diff --git a/libc/string/strcat.c b/libc/string/strcat.c index 5288f93ed..40a9be111 100644 --- a/libc/string/strcat.c +++ b/libc/string/strcat.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrcat __wcscat  # define Wstrcat wcscat  #else -# define __Wstrcat __strcat  # define Wstrcat strcat  #endif -Wchar attribute_hidden *__Wstrcat(Wchar * __restrict s1, register const Wchar * __restrict s2) +libc_hidden_proto(Wstrcat) + +Wchar *Wstrcat(Wchar * __restrict s1, register const Wchar * __restrict s2)  {  	register Wchar *s = s1; @@ -25,5 +25,4 @@ Wchar attribute_hidden *__Wstrcat(Wchar * __restrict s1, register const Wchar *  	return s1;  } - -strong_alias(__Wstrcat,Wstrcat) +libc_hidden_def(Wstrcat) diff --git a/libc/string/strchr.c b/libc/string/strchr.c index 93f394ab1..6bfd2077d 100644 --- a/libc/string/strchr.c +++ b/libc/string/strchr.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrchr __wcschr  # define Wstrchr wcschr  #else -# define __Wstrchr __strchr  # define Wstrchr strchr  #endif -Wchar attribute_hidden *__Wstrchr(register const Wchar *s, Wint c) +libc_hidden_proto(Wstrchr) + +Wchar *Wstrchr(register const Wchar *s, Wint c)  {  	do {  		if (*s == ((Wchar)c)) { @@ -25,9 +25,8 @@ Wchar attribute_hidden *__Wstrchr(register const Wchar *s, Wint c)  	return NULL;  } - -strong_alias(__Wstrchr,Wstrchr) +libc_hidden_def(Wstrchr)  #ifndef WANT_WIDE -strong_alias(__strchr,index) +strong_alias(strchr,index)  #endif diff --git a/libc/string/strchrnul.c b/libc/string/strchrnul.c index c498532fd..cc3883402 100644 --- a/libc/string/strchrnul.c +++ b/libc/string/strchrnul.c @@ -8,18 +8,17 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrchrnul __wcschrnul  # define Wstrchrnul wcschrnul  #else -# define __Wstrchrnul __strchrnul  # define Wstrchrnul strchrnul  #endif -Wchar attribute_hidden *__Wstrchrnul(register const Wchar *s, Wint c) +libc_hidden_proto(Wstrchrnul) + +Wchar *Wstrchrnul(register const Wchar *s, Wint c)  {  	--s;  	while (*++s && (*s != ((Wchar)c)));  	return (Wchar *) s;  } - -strong_alias(__Wstrchrnul,Wstrchrnul) +libc_hidden_def(Wstrchrnul) diff --git a/libc/string/strcmp.c b/libc/string/strcmp.c index 1fb8625ff..0ca95766c 100644 --- a/libc/string/strcmp.c +++ b/libc/string/strcmp.c @@ -8,14 +8,16 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrcmp __wcscmp  # define Wstrcmp wcscmp +# define Wstrcoll wcscoll  #else -# define __Wstrcmp __strcmp  # define Wstrcmp strcmp +# define Wstrcoll strcoll  #endif -int attribute_hidden __Wstrcmp(register const Wchar *s1, register const Wchar *s2) +libc_hidden_proto(Wstrcmp) + +int Wstrcmp(register const Wchar *s1, register const Wchar *s2)  {  #ifdef WANT_WIDE  	while (*((Wuchar *)s1) == *((Wuchar *)s2)) { @@ -35,15 +37,10 @@ int attribute_hidden __Wstrcmp(register const Wchar *s1, register const Wchar *s  	return r;  #endif  } - -strong_alias(__Wstrcmp,Wstrcmp) +libc_hidden_def(Wstrcmp)  #ifndef __UCLIBC_HAS_LOCALE__ -# ifdef WANT_WIDE -hidden_strong_alias(__wcscmp,__wcscoll) -strong_alias(__wcscmp,wcscoll) -# else -hidden_strong_alias(__strcmp,__strcoll) -strong_alias(__strcmp,strcoll) -# endif +strong_alias(Wstrcmp,Wstrcoll) +libc_hidden_proto(Wstrcoll) +libc_hidden_def(Wstrcoll)  #endif diff --git a/libc/string/strcpy.c b/libc/string/strcpy.c index 3b0e490eb..cda4094ac 100644 --- a/libc/string/strcpy.c +++ b/libc/string/strcpy.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrcpy __wcscpy  # define Wstrcpy wcscpy  #else -# define __Wstrcpy __strcpy  # define Wstrcpy strcpy  #endif -Wchar attribute_hidden *__Wstrcpy(Wchar * __restrict s1, const Wchar * __restrict s2) +libc_hidden_proto(Wstrcpy) + +Wchar *Wstrcpy(Wchar * __restrict s1, const Wchar * __restrict s2)  {  	register Wchar *s = s1; @@ -29,5 +29,4 @@ Wchar attribute_hidden *__Wstrcpy(Wchar * __restrict s1, const Wchar * __restric  	return s1;  } - -strong_alias(__Wstrcpy,Wstrcpy) +libc_hidden_def(Wstrcpy) diff --git a/libc/string/strcspn.c b/libc/string/strcspn.c index 7a709a77f..75d2e081b 100644 --- a/libc/string/strcspn.c +++ b/libc/string/strcspn.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrcspn __wcscspn  # define Wstrcspn wcscspn  #else -# define __Wstrcspn __strcspn +libc_hidden_proto(strcspn)  # define Wstrcspn strcspn  #endif -size_t attribute_hidden __Wstrcspn(const Wchar *s1, const Wchar *s2) +size_t Wstrcspn(const Wchar *s1, const Wchar *s2)  {  	register const Wchar *s;  	register const Wchar *p; @@ -29,4 +28,6 @@ size_t attribute_hidden __Wstrcspn(const Wchar *s1, const Wchar *s2)  	return s - s1;  } -strong_alias(__Wstrcspn,Wstrcspn) +#ifndef WANT_WIDE +libc_hidden_def(strcspn) +#endif diff --git a/libc/string/strdup.c b/libc/string/strdup.c index e2ccead9d..dff5af60a 100644 --- a/libc/string/strdup.c +++ b/libc/string/strdup.c @@ -9,18 +9,21 @@  #include <stdlib.h>  #ifdef WANT_WIDE -# define __Wstrdup __wcsdup +libc_hidden_proto(wcslen) +libc_hidden_proto(wcscpy)  # define Wstrdup wcsdup -# define Wstrlen __wcslen -# define Wstrcpy __wcscpy +# define Wstrlen wcslen +# define Wstrcpy wcscpy  #else -# define __Wstrdup __strdup +libc_hidden_proto(strdup) +libc_hidden_proto(strlen) +libc_hidden_proto(strcpy)  # define Wstrdup strdup -# define Wstrlen __strlen -# define Wstrcpy __strcpy +# define Wstrlen strlen +# define Wstrcpy strcpy  #endif -Wchar attribute_hidden *__Wstrdup(register const Wchar *s1) +Wchar *Wstrdup(register const Wchar *s1)  {  	register Wchar *s; @@ -31,4 +34,6 @@ Wchar attribute_hidden *__Wstrdup(register const Wchar *s1)  	return s;  } -strong_alias(__Wstrdup,Wstrdup) +#ifndef WANT_WIDE +libc_hidden_def(strdup) +#endif diff --git a/libc/string/strerror.c b/libc/string/strerror.c index a2f1f4833..1b5cb3ff2 100644 --- a/libc/string/strerror.c +++ b/libc/string/strerror.c @@ -9,13 +9,15 @@  #include <string.h>  #include "_syserrmsg.h" -char attribute_hidden *__strerror(int errnum) +libc_hidden_proto(strerror) +libc_hidden_proto(__xpg_strerror_r) + +char *strerror(int errnum)  {      static char buf[_STRERROR_BUFSIZE]; -	__xpg_strerror_r_internal(errnum, buf, sizeof(buf)); +	__xpg_strerror_r(errnum, buf, sizeof(buf));  	return buf;  } - -strong_alias(__strerror,strerror) +libc_hidden_def(strerror) diff --git a/libc/string/strlcpy.c b/libc/string/strlcpy.c index 3920db083..2f3d29fff 100644 --- a/libc/string/strlcpy.c +++ b/libc/string/strlcpy.c @@ -8,18 +8,22 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrlcpy __wcslcpy -# define Wstrlcpy wcslcpy +# define Wstrlcpy __wcslcpy +# define Wstrxfrm wcsxfrm  #else -# define __Wstrlcpy __strlcpy  # define Wstrlcpy strlcpy +# define Wstrxfrm strxfrm  #endif +  /* OpenBSD function:   * Copy at most n-1 chars from src to dst and nul-terminate dst.   * Returns strlen(src), so truncation occurred if the return value is >= n. */ -size_t attribute_hidden __Wstrlcpy(register Wchar *__restrict dst, +#ifdef WANT_WIDE +attribute_hidden +#endif +size_t Wstrlcpy(register Wchar *__restrict dst,  				  register const Wchar *__restrict src,  				  size_t n)  { @@ -42,15 +46,16 @@ size_t attribute_hidden __Wstrlcpy(register Wchar *__restrict dst,  	return src - src0;  } - -strong_alias(__Wstrlcpy,Wstrlcpy) - +#ifndef WANT_WIDE +libc_hidden_proto(strlcpy) +libc_hidden_def(strlcpy) +#ifndef __UCLIBC_HAS_LOCALE__ +strong_alias(strlcpy,strxfrm) +libc_hidden_proto(strxfrm) +libc_hidden_def(strxfrm) +#endif +#else  #ifndef __UCLIBC_HAS_LOCALE__ -# ifdef WANT_WIDE -hidden_strong_alias(__wcslcpy,__wcsxfrm)  strong_alias(__wcslcpy,wcsxfrm) -# else -hidden_strong_alias(__strlcpy,__strxfrm) -strong_alias(__strlcpy,strxfrm) -# endif +#endif  #endif diff --git a/libc/string/strlen.c b/libc/string/strlen.c index 27cd8481c..bcb096b97 100644 --- a/libc/string/strlen.c +++ b/libc/string/strlen.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrlen __wcslen  # define Wstrlen wcslen  #else -# define __Wstrlen __strlen  # define Wstrlen strlen  #endif -size_t attribute_hidden __Wstrlen(const Wchar *s) +libc_hidden_proto(Wstrlen) + +size_t Wstrlen(const Wchar *s)  {  	register const Wchar *p; @@ -23,5 +23,4 @@ size_t attribute_hidden __Wstrlen(const Wchar *s)  	return p - s;  } - -strong_alias(__Wstrlen,Wstrlen) +libc_hidden_def(Wstrlen) diff --git a/libc/string/strncasecmp.c b/libc/string/strncasecmp.c index bfc865a8c..1de214c73 100644 --- a/libc/string/strncasecmp.c +++ b/libc/string/strncasecmp.c @@ -9,44 +9,40 @@  #include <ctype.h>  #include <locale.h> -#ifdef __UCLIBC_HAS_XLOCALE__ -extern int __strncasecmp_l (__const char *__s1, __const char *__s2, -			  size_t __n, __locale_t __loc) -     __THROW __attribute_pure__ __nonnull ((1, 2, 4)) attribute_hidden; -extern int __wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2, -			  size_t __n, __locale_t __loc) __THROW attribute_hidden; -#endif -  #ifdef WANT_WIDE  # define strncasecmp wcsncasecmp -# define __strncasecmp __wcsncasecmp  # define strncasecmp_l wcsncasecmp_l -# define __strncasecmp_l __wcsncasecmp_l  # ifdef __UCLIBC_DO_XLOCALE -#  define TOLOWER(C) __towlower_l((C), locale_arg) -extern wint_t __towlower_l (wint_t __wc, __locale_t __locale) __THROW attribute_hidden; +libc_hidden_proto(towlower_l) +#  define TOLOWER(C) towlower_l((C), locale_arg)  # else -#  define TOLOWER(C) __towlower((C)) +libc_hidden_proto(towlower) +#  define TOLOWER(C) towlower((C))  # endif  #else  # ifdef __UCLIBC_DO_XLOCALE -#  define TOLOWER(C) __tolower_l((C), locale_arg) +libc_hidden_proto(tolower_l) +#  define TOLOWER(C) tolower_l((C), locale_arg)  # else -#  define TOLOWER(C) __tolower((C)) +libc_hidden_proto(tolower) +#  define TOLOWER(C) tolower((C))  # endif  #endif  #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -int attribute_hidden __strncasecmp(register const Wchar *s1, register const Wchar *s2, size_t n) +libc_hidden_proto(strncasecmp_l) + +int strncasecmp(register const Wchar *s1, register const Wchar *s2, size_t n)  { -	return __strncasecmp_l(s1, s2, n, __UCLIBC_CURLOCALE); +	return strncasecmp_l(s1, s2, n, __UCLIBC_CURLOCALE);  } -strong_alias(__strncasecmp,strncasecmp) +libc_hidden_proto(strncasecmp) +libc_hidden_def(strncasecmp)  #else  /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ -int attribute_hidden __UCXL(strncasecmp)(register const Wchar *s1, register const Wchar *s2, +int __XL_NPP(strncasecmp)(register const Wchar *s1, register const Wchar *s2,  					  size_t n   __LOCALE_PARAM )  {  #ifdef WANT_WIDE @@ -73,6 +69,7 @@ int attribute_hidden __UCXL(strncasecmp)(register const Wchar *s1, register cons  	return r;  #endif  } -__UCXL_ALIAS(strncasecmp) +libc_hidden_proto(__XL_NPP(strncasecmp)) +libc_hidden_def(__XL_NPP(strncasecmp))  #endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ diff --git a/libc/string/strncat.c b/libc/string/strncat.c index 20fbcfa27..61170c369 100644 --- a/libc/string/strncat.c +++ b/libc/string/strncat.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrncat __wcsncat  # define Wstrncat wcsncat  #else -# define __Wstrncat __strncat +libc_hidden_proto(strncat)  # define Wstrncat strncat  #endif -Wchar attribute_hidden *__Wstrncat(Wchar * __restrict s1, register const Wchar * __restrict s2, +Wchar *Wstrncat(Wchar * __restrict s1, register const Wchar * __restrict s2,  				size_t n)  {  	register Wchar *s = s1; @@ -35,4 +34,6 @@ Wchar attribute_hidden *__Wstrncat(Wchar * __restrict s1, register const Wchar *  	return s1;  } -strong_alias(__Wstrncat,Wstrncat) +#ifndef WANT_WIDE +libc_hidden_def(strncat) +#endif diff --git a/libc/string/strncmp.c b/libc/string/strncmp.c index ad80ce8e5..e7caf916c 100644 --- a/libc/string/strncmp.c +++ b/libc/string/strncmp.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrncmp __wcsncmp  # define Wstrncmp wcsncmp  #else -# define __Wstrncmp __strncmp +libc_hidden_proto(strncmp)  # define Wstrncmp strncmp  #endif -int attribute_hidden __Wstrncmp(register const Wchar *s1, register const Wchar *s2, size_t n) +int Wstrncmp(register const Wchar *s1, register const Wchar *s2, size_t n)  {  #ifdef WANT_WIDE  	while (n && (*((Wuchar *)s1) == *((Wuchar *)s2))) { @@ -38,5 +37,4 @@ int attribute_hidden __Wstrncmp(register const Wchar *s1, register const Wchar *  	return r;  #endif  } - -strong_alias(__Wstrncmp,Wstrncmp) +libc_hidden_def(strncmp) diff --git a/libc/string/strncpy.c b/libc/string/strncpy.c index 09124ac99..7c6654626 100644 --- a/libc/string/strncpy.c +++ b/libc/string/strncpy.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrncpy __wcsncpy  # define Wstrncpy wcsncpy  #else -# define __Wstrncpy __strncpy +libc_hidden_proto(strncpy)  # define Wstrncpy strncpy  #endif -Wchar attribute_hidden *__Wstrncpy(Wchar * __restrict s1, register const Wchar * __restrict s2, +Wchar *Wstrncpy(Wchar * __restrict s1, register const Wchar * __restrict s2,  				size_t n)  {  	register Wchar *s = s1; @@ -35,5 +34,4 @@ Wchar attribute_hidden *__Wstrncpy(Wchar * __restrict s1, register const Wchar *  	return s1;  } - -strong_alias(__Wstrncpy,Wstrncpy) +libc_hidden_def(strncpy) diff --git a/libc/string/strndup.c b/libc/string/strndup.c index 5cee0272d..89c58ccec 100644 --- a/libc/string/strndup.c +++ b/libc/string/strndup.c @@ -8,18 +8,21 @@  #include "_string.h"  #include <stdlib.h> -char attribute_hidden *__strndup(register const char *s1, size_t n) +libc_hidden_proto(strndup) +libc_hidden_proto(strnlen) +libc_hidden_proto(memcpy) + +char *strndup(register const char *s1, size_t n)  {  	register char *s; -	n = __strnlen(s1,n);			/* Avoid problems if s1 not nul-terminated. */ +	n = strnlen(s1,n);			/* Avoid problems if s1 not nul-terminated. */      if ((s = malloc(n + 1)) != NULL) { -		__memcpy(s, s1, n); +		memcpy(s, s1, n);  		s[n] = 0;  	}  	return s;  } - -strong_alias(__strndup,strndup) +libc_hidden_def(strndup) diff --git a/libc/string/strnlen.c b/libc/string/strnlen.c index 6732cc532..547dd23b2 100644 --- a/libc/string/strnlen.c +++ b/libc/string/strnlen.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrnlen __wcsnlen  # define Wstrnlen wcsnlen  #else -# define __Wstrnlen __strnlen  # define Wstrnlen strnlen  #endif -size_t attribute_hidden __Wstrnlen(const Wchar *s, size_t max) +libc_hidden_proto(Wstrnlen) + +size_t Wstrnlen(const Wchar *s, size_t max)  {  	register const Wchar *p = s;  #ifdef __BCC__ @@ -34,4 +34,4 @@ size_t attribute_hidden __Wstrnlen(const Wchar *s, size_t max)  }  #undef maxp -strong_alias(__Wstrnlen,Wstrnlen) +libc_hidden_def(Wstrnlen) diff --git a/libc/string/strpbrk.c b/libc/string/strpbrk.c index 704b1bc71..abeb84380 100644 --- a/libc/string/strpbrk.c +++ b/libc/string/strpbrk.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrpbrk __wcspbrk  # define Wstrpbrk wcspbrk  #else -# define __Wstrpbrk __strpbrk  # define Wstrpbrk strpbrk  #endif -Wchar attribute_hidden *__Wstrpbrk(const Wchar *s1, const Wchar *s2) +libc_hidden_proto(Wstrpbrk) + +Wchar *Wstrpbrk(const Wchar *s1, const Wchar *s2)  {  	register const Wchar *s;  	register const Wchar *p; @@ -27,5 +27,4 @@ Wchar attribute_hidden *__Wstrpbrk(const Wchar *s1, const Wchar *s2)  	}  	return NULL;  } - -strong_alias(__Wstrpbrk,Wstrpbrk) +libc_hidden_def(Wstrpbrk) diff --git a/libc/string/strrchr.c b/libc/string/strrchr.c index cb30afea7..7c44a346a 100644 --- a/libc/string/strrchr.c +++ b/libc/string/strrchr.c @@ -8,14 +8,13 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrrchr __wcsrchr  # define Wstrrchr wcsrchr  #else -# define __Wstrrchr __strrchr +libc_hidden_proto(strrchr)  # define Wstrrchr strrchr  #endif -Wchar attribute_hidden *__Wstrrchr(register const  Wchar *s, Wint c) +Wchar *Wstrrchr(register const  Wchar *s, Wint c)  {  	register const Wchar *p; @@ -28,8 +27,7 @@ Wchar attribute_hidden *__Wstrrchr(register const  Wchar *s, Wint c)  	return (Wchar *) p;			/* silence the warning */  } - -strong_alias(__Wstrrchr,Wstrrchr) +libc_hidden_def(strrchr)  #ifndef WANT_WIDE -strong_alias(__strrchr,rindex) +strong_alias(strrchr,rindex)  #endif diff --git a/libc/string/strsep.c b/libc/string/strsep.c index 993fafecb..7f421891e 100644 --- a/libc/string/strsep.c +++ b/libc/string/strsep.c @@ -7,18 +7,22 @@  #include "_string.h" -char attribute_hidden *__strsep(char ** __restrict s1, const char * __restrict s2) +libc_hidden_proto(strsep) +libc_hidden_proto(strpbrk) +libc_hidden_proto(strcspn) + +char *strsep(char ** __restrict s1, const char * __restrict s2)  {  	register char *s = *s1;  	register char *p;  #if 1  	p = NULL; -	if (s && *s && (p = __strpbrk(s, s2))) { +	if (s && *s && (p = strpbrk(s, s2))) {  		*p++ = 0;  	}  #else -	if (s && *s && *(p = s + __strcspn(s, s2))) { +	if (s && *s && *(p = s + strcspn(s, s2))) {  		*p++ = 0;  	} else {  		p = NULL; @@ -27,5 +31,4 @@ char attribute_hidden *__strsep(char ** __restrict s1, const char * __restrict s  	*s1 = p;  	return s;  } - -strong_alias(__strsep,strsep) +libc_hidden_def(strsep) diff --git a/libc/string/strsignal.c b/libc/string/strsignal.c index 13aa3b1ad..b99facc81 100644 --- a/libc/string/strsignal.c +++ b/libc/string/strsignal.c @@ -19,6 +19,9 @@  #include <bits/uClibc_uintmaxtostr.h>  #include <signal.h> +libc_hidden_proto(strsignal) +libc_hidden_proto(memcpy) +  #define _SYS_NSIG			32  #ifdef __UCLIBC_HAS_SIGNUM_MESSAGES__ @@ -81,7 +84,7 @@ static const unsigned char sstridx[] = {  };  #endif -char attribute_hidden *__strsignal(int signum) +char *strsignal(int signum)  {      register char *s;      int i; @@ -120,7 +123,7 @@ char attribute_hidden *__strsignal(int signum)      }      s = _int10tostr(buf+sizeof(buf)-1, signum) - sizeof(unknown); -    __memcpy(s, unknown, sizeof(unknown)); +    memcpy(s, unknown, sizeof(unknown));   DONE:  	return s; @@ -128,18 +131,18 @@ char attribute_hidden *__strsignal(int signum)  #else  /* __UCLIBC_HAS_SIGNUM_MESSAGES__ */ -char attribute_hidden *__strsignal(int signum) +char *strsignal(int signum)  {      static char buf[_STRSIGNAL_BUFSIZE];      static const char unknown[] = {  		'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 's', 'i', 'g', 'n', 'a', 'l', ' '      }; -    return (char *) __memcpy(_int10tostr(buf+sizeof(buf)-1, signum) +    return (char *) memcpy(_int10tostr(buf+sizeof(buf)-1, signum)  						   - sizeof(unknown),  						   unknown, sizeof(unknown));  }  #endif /* __UCLIBC_HAS_SIGNUM_MESSAGES__ */ -strong_alias(__strsignal,strsignal) +libc_hidden_def(strsignal) diff --git a/libc/string/strspn.c b/libc/string/strspn.c index 9074c13ad..ca83ef900 100644 --- a/libc/string/strspn.c +++ b/libc/string/strspn.c @@ -8,14 +8,14 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrspn __wcsspn  # define Wstrspn wcsspn  #else -# define __Wstrspn __strspn  # define Wstrspn strspn  #endif -size_t attribute_hidden __Wstrspn(const Wchar *s1, const Wchar *s2) +libc_hidden_proto(Wstrspn) + +size_t Wstrspn(const Wchar *s1, const Wchar *s2)  {  	register const Wchar *s = s1;  	register const Wchar *p = s2; @@ -28,5 +28,4 @@ size_t attribute_hidden __Wstrspn(const Wchar *s1, const Wchar *s2)  	}  	return s - s1;  } - -strong_alias(__Wstrspn,Wstrspn) +libc_hidden_def(Wstrspn) diff --git a/libc/string/strstr.c b/libc/string/strstr.c index 7256b9da2..685a2f83c 100644 --- a/libc/string/strstr.c +++ b/libc/string/strstr.c @@ -8,16 +8,15 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrstr __wcsstr  # define Wstrstr wcsstr  #else -# define __Wstrstr __strstr +libc_hidden_proto(strstr)  # define Wstrstr strstr  #endif  /* NOTE: This is the simple-minded O(len(s1) * len(s2)) worst-case approach. */ -Wchar attribute_hidden *__Wstrstr(const Wchar *s1, const Wchar *s2) +Wchar *Wstrstr(const Wchar *s1, const Wchar *s2)  {  	register const Wchar *s = s1;  	register const Wchar *p = s2; @@ -38,8 +37,8 @@ Wchar attribute_hidden *__Wstrstr(const Wchar *s1, const Wchar *s2)  		}  	} while (1);  } - -strong_alias(__Wstrstr,Wstrstr) -#ifdef WANT_WIDE -strong_alias(__wcsstr,wcswcs) +#ifndef WANT_WIDE +libc_hidden_def(strstr) +#else +strong_alias(wcsstr,wcswcs)  #endif diff --git a/libc/string/strtok.c b/libc/string/strtok.c index 4b8aef6b5..127497c9d 100644 --- a/libc/string/strtok.c +++ b/libc/string/strtok.c @@ -9,12 +9,14 @@  #if 0 /*def WANT_WIDE*/  # define Wstrtok wcstok -# define Wstrtok_r __wcstok_r +# define Wstrtok_r wcstok_r  #else  # define Wstrtok strtok -# define Wstrtok_r __strtok_r +# define Wstrtok_r strtok_r  #endif +libc_hidden_proto(Wstrtok_r) +  Wchar *Wstrtok(Wchar * __restrict s1, const Wchar * __restrict s2)  {  	static Wchar *next_start;	/* Initialized to 0 since in bss. */ diff --git a/libc/string/strtok_r.c b/libc/string/strtok_r.c index c8ba588eb..bda56d71c 100644 --- a/libc/string/strtok_r.c +++ b/libc/string/strtok_r.c @@ -8,18 +8,21 @@  #include "_string.h"  #ifdef WANT_WIDE -# define __Wstrtok_r __wcstok +libc_hidden_proto(wcsspn) +libc_hidden_proto(wcspbrk)  # define Wstrtok_r wcstok -# define Wstrspn __wcsspn -# define Wstrpbrk __wcspbrk +# define Wstrspn wcsspn +# define Wstrpbrk wcspbrk  #else -# define __Wstrtok_r __strtok_r +libc_hidden_proto(strtok_r) +libc_hidden_proto(strspn) +libc_hidden_proto(strpbrk)  # define Wstrtok_r strtok_r -# define Wstrspn __strspn -# define Wstrpbrk __strpbrk +# define Wstrspn strspn +# define Wstrpbrk strpbrk  #endif -Wchar attribute_hidden *__Wstrtok_r(Wchar * __restrict s1, const Wchar * __restrict s2, +Wchar *Wstrtok_r(Wchar * __restrict s1, const Wchar * __restrict s2,  				 Wchar ** __restrict next_start)  {  	register Wchar *s; @@ -52,4 +55,6 @@ Wchar attribute_hidden *__Wstrtok_r(Wchar * __restrict s1, const Wchar * __restr  #endif  } -strong_alias(__Wstrtok_r,Wstrtok_r) +#ifndef WANT_WIDE +libc_hidden_def(strtok_r) +#endif diff --git a/libc/string/x86_64/_glibc_inc.h b/libc/string/x86_64/_glibc_inc.h index 3c31957db..88cef2ea3 100644 --- a/libc/string/x86_64/_glibc_inc.h +++ b/libc/string/x86_64/_glibc_inc.h @@ -14,7 +14,6 @@  #define ENTRY(sym) \  	.global sym; \ -	.hidden sym; \  	.align  ENTRY_ALIGN; \  	.type   sym,%function; \  	sym: diff --git a/libc/string/x86_64/bzero.S b/libc/string/x86_64/bzero.S index 73ba75436..2b6ac0988 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" -strong_alias(__bzero,bzero) +libc_hidden_def(bzero) diff --git a/libc/string/x86_64/memcpy.S b/libc/string/x86_64/memcpy.S index 973cd513f..b3bb0f96c 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,7 +32,7 @@ ENTRY (__memcpy_chk)  	jb	HIDDEN_JUMPTARGET (__chk_fail)  END (__memcpy_chk)  #endif -ENTRY (BP_SYM (__memcpy)) +ENTRY (BP_SYM (memcpy))  	/* Cutoff for the big loop is a size of 32 bytes since otherwise  	   the loop will never be entered.  */  	cmpq	$32, %rdx @@ -92,7 +92,7 @@ ENTRY (BP_SYM (__memcpy))  #endif  	ret -END (BP_SYM (__memcpy)) +END (BP_SYM (memcpy))  #if !MEMPCPY_P -strong_alias(__memcpy,memcpy) +libc_hidden_def(memcpy)  #endif diff --git a/libc/string/x86_64/mempcpy.S b/libc/string/x86_64/mempcpy.S index 3a8e925fd..3816d9f72 100644 --- a/libc/string/x86_64/mempcpy.S +++ b/libc/string/x86_64/mempcpy.S @@ -1,3 +1,3 @@ -#define __memcpy __mempcpy +#define memcpy mempcpy  #include "memcpy.S" -strong_alias(__mempcpy,mempcpy) +libc_hidden_def(mempcpy) diff --git a/libc/string/x86_64/memset.S b/libc/string/x86_64/memset.S index 923e1c208..d72d74468 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,7 +35,7 @@ ENTRY (__memset_chk)  	jb	HIDDEN_JUMPTARGET (__chk_fail)  END (__memset_chk)  #endif -ENTRY (__memset) +ENTRY (memset)  #if BZERO_P  	mov	%rsi,%rdx	/* Adjust parameter.  */  	xorl	%esi,%esi	/* Fill with 0s.  */ @@ -131,9 +131,9 @@ ENTRY (__memset)  	jne	11b  	jmp	4b -END (__memset) +END (memset)  #if !BZERO_P -strong_alias(__memset,memset) +libc_hidden_def(memset)  #endif  #if !BZERO_P && defined PIC && !defined NOT_IN_libc diff --git a/libc/string/x86_64/stpcpy.S b/libc/string/x86_64/stpcpy.S index 075773371..138d0fb17 100644 --- a/libc/string/x86_64/stpcpy.S +++ b/libc/string/x86_64/stpcpy.S @@ -1,4 +1,4 @@  #define USE_AS_STPCPY -#define STRCPY __stpcpy +#define STRCPY stpcpy  #include "strcpy.S" -strong_alias(__stpcpy,stpcpy) +libc_hidden_def(stpcpy) diff --git a/libc/string/x86_64/strcat.S b/libc/string/x86_64/strcat.S index 6c7189a21..9b0068981 100644 --- a/libc/string/x86_64/strcat.S +++ b/libc/string/x86_64/strcat.S @@ -23,7 +23,7 @@  	.text -ENTRY (BP_SYM (__strcat)) +ENTRY (BP_SYM (strcat))  	movq %rdi, %rcx		/* Dest. register. */  	andl $7, %ecx		/* mask alignment bits */  	movq %rdi, %rax		/* Duplicate destination pointer.  */ @@ -253,6 +253,6 @@ ENTRY (BP_SYM (__strcat))  24:  	movq	%rdi, %rax	/* Source is return value.  */  	retq -END (BP_SYM (__strcat)) +END (BP_SYM (strcat)) -strong_alias(__strcat,strcat) +libc_hidden_def(strcat) diff --git a/libc/string/x86_64/strchr.S b/libc/string/x86_64/strchr.S index 312d62b61..6f6635a39 100644 --- a/libc/string/x86_64/strchr.S +++ b/libc/string/x86_64/strchr.S @@ -22,7 +22,7 @@  	.text -ENTRY (BP_SYM (__strchr)) +ENTRY (BP_SYM (strchr))  	/* Before we start with the main loop we process single bytes  	   until the source pointer is aligned.  This has two reasons: @@ -282,7 +282,7 @@ ENTRY (BP_SYM (__strchr))  6:  	nop  	retq -END (BP_SYM (__strchr)) +END (BP_SYM (strchr)) -strong_alias(__strchr,strchr) -strong_alias (BP_SYM (__strchr), BP_SYM (index)) +libc_hidden_def(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 b0252f341..437e145bf 100644 --- a/libc/string/x86_64/strcmp.S +++ b/libc/string/x86_64/strcmp.S @@ -22,7 +22,7 @@  #include "_glibc_inc.h"          .text -ENTRY (BP_SYM (__strcmp)) +ENTRY (BP_SYM (strcmp))  L(oop):	movb	(%rdi), %al  	cmpb	(%rsi), %al  	jne	L(neq) @@ -38,10 +38,10 @@ L(neq):	movl	$1, %eax  	movl	$-1, %ecx  	cmovbl	%ecx, %eax  	ret -END (BP_SYM (__strcmp)) +END (BP_SYM (strcmp)) -strong_alias(__strcmp,strcmp) +libc_hidden_def(strcmp)  #ifndef __UCLIBC_HAS_LOCALE__ -hidden_strong_alias(__strcmp,__strcoll) -strong_alias(__strcmp,strcoll) +strong_alias(strcmp,strcoll) +libc_hidden_def(strcoll)  #endif diff --git a/libc/string/x86_64/strcpy.S b/libc/string/x86_64/strcpy.S index 0bd2a6471..d9a51b0bb 100644 --- a/libc/string/x86_64/strcpy.S +++ b/libc/string/x86_64/strcpy.S @@ -21,7 +21,7 @@  #include "_glibc_inc.h"  #ifndef USE_AS_STPCPY -# define STRCPY __strcpy +# define STRCPY strcpy  #endif  	.text @@ -152,5 +152,5 @@ ENTRY (BP_SYM (STRCPY))  	retq  END (BP_SYM (STRCPY))  #ifndef USE_AS_STPCPY -strong_alias(__strcpy,strcpy) +libc_hidden_def(strcpy)  #endif diff --git a/libc/string/x86_64/strcspn.S b/libc/string/x86_64/strcspn.S index 35959e500..fed12b5f6 100644 --- a/libc/string/x86_64/strcspn.S +++ b/libc/string/x86_64/strcspn.S @@ -26,10 +26,10 @@  #include "_glibc_inc.h"  /* BEWARE: `#ifdef strcspn' means that strcspn is redefined as `strpbrk' */ -#define STRPBRK_P (defined __strcspn) +#define STRPBRK_P (defined strcspn)  	.text -ENTRY (__strcspn) +ENTRY (strcspn)  	movq %rdi, %rdx		/* Save SRC.  */ @@ -120,8 +120,8 @@ L(4):	addq $256, %rsp		/* remove skipset */  				   non-valid character */  #endif  	ret -END (__strcspn) +END (strcspn)  #if !STRPBRK_P -strong_alias(__strcspn,strcspn) +libc_hidden_def(strcspn)  #endif diff --git a/libc/string/x86_64/strlen.S b/libc/string/x86_64/strlen.S index 77aae71ba..0441dc46c 100644 --- a/libc/string/x86_64/strlen.S +++ b/libc/string/x86_64/strlen.S @@ -22,7 +22,7 @@  	.text -ENTRY (__strlen) +ENTRY (strlen)  	movq %rdi, %rcx		/* Duplicate source pointer. */  	andl $7, %ecx		/* mask alignment bits */  	movq %rdi, %rax		/* duplicate destination.  */ @@ -132,6 +132,6 @@ ENTRY (__strlen)  2:  	subq %rdi, %rax		/* compute difference to string start */  	ret -END (__strlen) +END (strlen) -strong_alias(__strlen,strlen) +libc_hidden_def(strlen) diff --git a/libc/string/x86_64/strpbrk.S b/libc/string/x86_64/strpbrk.S index 94b14d091..72a47bcb9 100644 --- a/libc/string/x86_64/strpbrk.S +++ b/libc/string/x86_64/strpbrk.S @@ -1,3 +1,3 @@ -#define __strcspn __strpbrk +#define strcspn strpbrk  #include "strcspn.S" -strong_alias(__strpbrk,strpbrk) +libc_hidden_proto(strpbrk) diff --git a/libc/string/x86_64/strspn.S b/libc/string/x86_64/strspn.S index ae5b4a1df..c126abd2e 100644 --- a/libc/string/x86_64/strspn.S +++ b/libc/string/x86_64/strspn.S @@ -26,7 +26,7 @@  #include "_glibc_inc.h"  	.text -ENTRY (__strspn) +ENTRY (strspn)  	movq %rdi, %rdx		/* Save SRC.  */ @@ -111,6 +111,6 @@ L(4):	addq $256, %rsp		/* remove stopset */  				   characters, so compute distance to first  				   non-valid character */  	ret -END (__strspn) +END (strspn) -strong_alias(__strspn,strspn) +libc_hidden_def(strspn)  | 
