summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-16 18:07:18 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-16 18:07:18 +0000
commitb25ad630be8b0f362fea44a97efbead83d1dd2ae (patch)
tree6f45eed6bf053c9e105d6b67bc1d765b49b58e61
parente4a6dbb41c73cf86b95beca2d0e2bb6f0530ef79 (diff)
Last relocs jump and global data, (even locales) that I could remove are gone from libc. The remaining are left as exercise for others ;-)
-rw-r--r--libc/inet/addr.c5
-rw-r--r--libc/inet/ether_addr.c7
-rw-r--r--libc/inet/herror.c1
-rw-r--r--libc/inet/inet_net.c5
-rw-r--r--libc/inet/resolv.c5
-rw-r--r--libc/inet/rpc/auth_unix.c1
-rw-r--r--libc/inet/rpc/clnt_tcp.c3
-rw-r--r--libc/inet/rpc/clnt_udp.c1
-rw-r--r--libc/inet/rpc/clnt_unix.c1
-rw-r--r--libc/inet/rpc/rcmd.c8
-rw-r--r--libc/inet/rpc/rpc_private.h1
-rw-r--r--libc/inet/rpc/svc_tcp.c1
-rw-r--r--libc/inet/rpc/svc_udp.c1
-rw-r--r--libc/inet/rpc/svc_unix.c1
-rw-r--r--libc/inet/rpc/xdr.c1
-rw-r--r--libc/inet/rpc/xdr_array.c1
-rw-r--r--libc/inet/rpc/xdr_rec.c1
-rw-r--r--libc/inet/rpc/xdr_reference.c1
-rw-r--r--libc/misc/assert/__assert.c1
-rw-r--r--libc/misc/ctype/ctype.c40
-rw-r--r--libc/misc/error/err.c1
-rw-r--r--libc/misc/error/error.c2
-rw-r--r--libc/misc/fnmatch/fnmatch.c7
-rw-r--r--libc/misc/gnu/obstack.c5
-rw-r--r--libc/misc/internals/__errno_location.c4
-rw-r--r--libc/misc/internals/__h_errno_location.c2
-rw-r--r--libc/misc/internals/__uClibc_main.c4
-rw-r--r--libc/misc/internals/errno.c9
-rw-r--r--libc/misc/locale/locale.c21
-rw-r--r--libc/misc/regex/regex.c7
-rw-r--r--libc/misc/time/time.c13
-rw-r--r--libc/misc/ttyent/getttyent.c5
-rw-r--r--libc/misc/wchar/wchar.c6
-rw-r--r--libc/misc/wctype/wctype.c7
-rw-r--r--libc/pwd_grp/pwd_grp.c5
-rw-r--r--libc/stdio/_fpmaxtostr.c3
-rw-r--r--libc/stdio/_stdio.c7
-rw-r--r--libc/stdio/_stdio.h3
-rw-r--r--libc/stdio/_uintmaxtostr.c3
-rw-r--r--libc/stdio/gets.c1
-rw-r--r--libc/stdio/perror.c1
-rw-r--r--libc/stdio/scanf.c8
-rw-r--r--libc/stdio/vfprintf.c14
-rw-r--r--libc/stdlib/atexit.c4
-rw-r--r--libc/stdlib/getenv.c1
-rw-r--r--libc/stdlib/malloc-standard/mallinfo.c1
-rw-r--r--libc/stdlib/setenv.c1
-rw-r--r--libc/stdlib/stdlib.c12
-rw-r--r--libc/stdlib/strtod.c10
-rw-r--r--libc/string/_collate.c2
-rw-r--r--libc/string/psignal.c1
-rw-r--r--libc/string/strcasecmp.c3
-rw-r--r--libc/string/strcasestr.c5
-rw-r--r--libc/string/strncasecmp.c3
-rw-r--r--libc/sysdeps/linux/common/bits/errno.h3
-rw-r--r--libc/unistd/exec.c1
-rw-r--r--libc/unistd/getopt.c25
-rw-r--r--libc/unistd/getpass.c2
-rw-r--r--libc/unistd/usershell.c5
59 files changed, 285 insertions, 18 deletions
diff --git a/libc/inet/addr.c b/libc/inet/addr.c
index 538d9fb8e..f871d5efc 100644
--- a/libc/inet/addr.c
+++ b/libc/inet/addr.c
@@ -43,6 +43,11 @@
* leading 0 -> octal
* all else -> decimal
*/
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
libc_hidden_proto(inet_aton)
int inet_aton(const char *cp, struct in_addr *addrptr)
{
diff --git a/libc/inet/ether_addr.c b/libc/inet/ether_addr.c
index 8be160a0d..13414826e 100644
--- a/libc/inet/ether_addr.c
+++ b/libc/inet/ether_addr.c
@@ -34,6 +34,13 @@
libc_hidden_proto(ether_aton_r)
libc_hidden_proto(ether_ntoa_r)
libc_hidden_proto(sprintf)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+libc_hidden_proto(__ctype_tolower_loc)
+#else
+libc_hidden_proto(__ctype_b)
+libc_hidden_proto(__ctype_tolower)
+#endif
struct ether_addr *ether_aton_r(const char *asc, struct ether_addr *addr)
{
diff --git a/libc/inet/herror.c b/libc/inet/herror.c
index 063f6e93e..66626c0a8 100644
--- a/libc/inet/herror.c
+++ b/libc/inet/herror.c
@@ -25,6 +25,7 @@
libc_hidden_proto(fprintf)
libc_hidden_proto(__h_errno_location)
+libc_hidden_proto(stderr)
static const char *error_msg = "Resolver error";
static const char *const h_errlist[] = {
diff --git a/libc/inet/inet_net.c b/libc/inet/inet_net.c
index 59cf36022..64c6c3e84 100644
--- a/libc/inet/inet_net.c
+++ b/libc/inet/inet_net.c
@@ -37,6 +37,11 @@
#include <ctype.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
/*
* Internet network address interpretation routine.
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 7ebaaca2d..0b479ee20 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -200,6 +200,11 @@ libc_hidden_proto(res_querydomain)
libc_hidden_proto(gethostent_r)
libc_hidden_proto(fprintf)
libc_hidden_proto(__h_errno_location)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
#define MAX_RECURSE 5
#define REPLY_TIMEOUT 10
diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c
index 80b60b56b..7644ab276 100644
--- a/libc/inet/rpc/auth_unix.c
+++ b/libc/inet/rpc/auth_unix.c
@@ -69,6 +69,7 @@ libc_hidden_proto(gettimeofday)
libc_hidden_proto(fputs)
libc_hidden_proto(perror)
libc_hidden_proto(abort)
+libc_hidden_proto(stderr)
#ifdef USE_IN_LIBIO
libc_hidden_proto(fwprintf)
#endif
diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c
index 349e89f39..6d19df31c 100644
--- a/libc/inet/rpc/clnt_tcp.c
+++ b/libc/inet/rpc/clnt_tcp.c
@@ -84,10 +84,11 @@ libc_hidden_proto(connect)
libc_hidden_proto(bindresvport)
libc_hidden_proto(poll)
libc_hidden_proto(fputs)
+libc_hidden_proto(__rpc_thread_createerr)
+libc_hidden_proto(stderr)
#ifdef USE_IN_LIBIO
libc_hidden_proto(fwprintf)
#endif
-libc_hidden_proto(__rpc_thread_createerr)
extern u_long _create_xid (void) attribute_hidden;
diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c
index 9e3444069..9b01d2751 100644
--- a/libc/inet/rpc/clnt_udp.c
+++ b/libc/inet/rpc/clnt_udp.c
@@ -84,6 +84,7 @@ libc_hidden_proto(recvmsg)
libc_hidden_proto(poll)
libc_hidden_proto(fputs)
libc_hidden_proto(__rpc_thread_createerr)
+libc_hidden_proto(stderr)
extern u_long _create_xid (void) attribute_hidden;
diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c
index 82f994e51..c5e949db6 100644
--- a/libc/inet/rpc/clnt_unix.c
+++ b/libc/inet/rpc/clnt_unix.c
@@ -87,6 +87,7 @@ libc_hidden_proto(sendmsg)
libc_hidden_proto(poll)
libc_hidden_proto(fputs)
libc_hidden_proto(__rpc_thread_createerr)
+libc_hidden_proto(stderr)
extern u_long _create_xid (void) attribute_hidden;
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index a34110cee..728f301ea 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/libc/inet/rpc/rcmd.c
@@ -102,6 +102,14 @@ libc_hidden_proto(fopen)
libc_hidden_proto(fclose)
libc_hidden_proto(fprintf)
libc_hidden_proto(__h_errno_location)
+libc_hidden_proto(stderr)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+libc_hidden_proto(__ctype_tolower_loc)
+#else
+libc_hidden_proto(__ctype_b)
+libc_hidden_proto(__ctype_tolower)
+#endif
libc_hidden_proto(rresvport)
diff --git a/libc/inet/rpc/rpc_private.h b/libc/inet/rpc/rpc_private.h
index 15250059a..4826d362b 100644
--- a/libc/inet/rpc/rpc_private.h
+++ b/libc/inet/rpc/rpc_private.h
@@ -5,6 +5,7 @@
extern u_long _create_xid (void) attribute_hidden;
libc_hidden_proto(__rpc_thread_createerr)
+libc_hidden_proto(stderr)
/*
* Multi-threaded support
diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c
index 13a2469dd..1ae0dedcd 100644
--- a/libc/inet/rpc/svc_tcp.c
+++ b/libc/inet/rpc/svc_tcp.c
@@ -84,6 +84,7 @@ libc_hidden_proto(listen)
libc_hidden_proto(fputs)
libc_hidden_proto(fclose)
libc_hidden_proto(abort)
+libc_hidden_proto(stderr)
/*
* Ops vector for TCP/IP based rpc service handle
diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c
index fc01c2848..7494bdac6 100644
--- a/libc/inet/rpc/svc_udp.c
+++ b/libc/inet/rpc/svc_udp.c
@@ -82,6 +82,7 @@ libc_hidden_proto(recvmsg)
libc_hidden_proto(sendmsg)
libc_hidden_proto(fputs)
libc_hidden_proto(fprintf)
+libc_hidden_proto(stderr)
#define rpc_buffer(xprt) ((xprt)->xp_p1)
#ifndef MAX
diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c
index 02e327a8e..3e4b6ea6b 100644
--- a/libc/inet/rpc/svc_unix.c
+++ b/libc/inet/rpc/svc_unix.c
@@ -82,6 +82,7 @@ libc_hidden_proto(accept)
libc_hidden_proto(listen)
libc_hidden_proto(fputs)
libc_hidden_proto(abort)
+libc_hidden_proto(stderr)
/*
* Ops vector for AF_UNIX based rpc service handle
diff --git a/libc/inet/rpc/xdr.c b/libc/inet/rpc/xdr.c
index 54778935c..031fe9bcb 100644
--- a/libc/inet/rpc/xdr.c
+++ b/libc/inet/rpc/xdr.c
@@ -59,6 +59,7 @@ libc_hidden_proto(fwprintf)
libc_hidden_proto(strlen)
libc_hidden_proto(fputs)
+libc_hidden_proto(stderr)
/*
* constants specific to the xdr "protocol"
diff --git a/libc/inet/rpc/xdr_array.c b/libc/inet/rpc/xdr_array.c
index 45faccfae..fc926026f 100644
--- a/libc/inet/rpc/xdr_array.c
+++ b/libc/inet/rpc/xdr_array.c
@@ -58,6 +58,7 @@ libc_hidden_proto(fwprintf)
libc_hidden_proto(memset)
libc_hidden_proto(fputs)
libc_hidden_proto(xdr_u_int)
+libc_hidden_proto(stderr)
#define LASTUNSIGNED ((u_int)0-1)
diff --git a/libc/inet/rpc/xdr_rec.c b/libc/inet/rpc/xdr_rec.c
index 76c9ba39c..11c4ced7c 100644
--- a/libc/inet/rpc/xdr_rec.c
+++ b/libc/inet/rpc/xdr_rec.c
@@ -64,6 +64,7 @@ libc_hidden_proto(fwprintf)
libc_hidden_proto(memcpy)
libc_hidden_proto(fputs)
libc_hidden_proto(lseek)
+libc_hidden_proto(stderr)
static bool_t xdrrec_getlong (XDR *, long *);
static bool_t xdrrec_putlong (XDR *, const long *);
diff --git a/libc/inet/rpc/xdr_reference.c b/libc/inet/rpc/xdr_reference.c
index 43a62e598..bf175404c 100644
--- a/libc/inet/rpc/xdr_reference.c
+++ b/libc/inet/rpc/xdr_reference.c
@@ -59,6 +59,7 @@ libc_hidden_proto(fwprintf)
libc_hidden_proto(memset)
libc_hidden_proto(xdr_bool)
libc_hidden_proto(fputs)
+libc_hidden_proto(stderr)
#define LASTUNSIGNED ((u_int)0-1)
diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c
index 130bb044f..a0b215957 100644
--- a/libc/misc/assert/__assert.c
+++ b/libc/misc/assert/__assert.c
@@ -35,6 +35,7 @@
libc_hidden_proto(fprintf)
libc_hidden_proto(abort)
+libc_hidden_proto(stderr)
/* Get the prototype from assert.h as a double-check. */
#undef NDEBUG
diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c
index cb1645ef7..9a220ac63 100644
--- a/libc/misc/ctype/ctype.c
+++ b/libc/misc/ctype/ctype.c
@@ -36,6 +36,11 @@
#include <stdint.h>
#include <assert.h>
#include <locale.h>
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
#ifdef __UCLIBC_HAS_XLOCALE__
#include <xlocale.h>
@@ -270,6 +275,11 @@ IS_FUNC_BODY(xdigit);
#ifdef L_tolower
#undef tolower
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_tolower_loc)
+#else
+libc_hidden_proto(__ctype_tolower)
+#endif
libc_hidden_proto(tolower)
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
@@ -311,6 +321,11 @@ libc_hidden_def(tolower_l)
#ifdef L_toupper
#undef toupper
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_toupper_loc)
+#else
+libc_hidden_proto(__ctype_toupper)
+#endif
libc_hidden_proto(toupper)
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
@@ -411,6 +426,7 @@ const __ctype_mask_t **__ctype_b_loc(void)
return &(__UCLIBC_CURLOCALE_DATA).__ctype_b;
}
+libc_hidden_def(__ctype_b_loc)
#endif
#endif
@@ -419,10 +435,12 @@ const __ctype_mask_t **__ctype_b_loc(void)
#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_tolower_loc)
const __ctype_touplow_t **__ctype_tolower_loc(void)
{
return &(__UCLIBC_CURLOCALE_DATA).__ctype_tolower;
}
+libc_hidden_def(__ctype_tolower_loc)
#endif
@@ -432,10 +450,12 @@ const __ctype_touplow_t **__ctype_tolower_loc(void)
#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_toupper_loc)
const __ctype_touplow_t **__ctype_toupper_loc(void)
{
return &(__UCLIBC_CURLOCALE_DATA).__ctype_toupper;
}
+libc_hidden_def(__ctype_toupper_loc)
#endif
@@ -443,6 +463,8 @@ const __ctype_touplow_t **__ctype_toupper_loc(void)
/**********************************************************************/
#ifdef L___C_ctype_b
+extern const __ctype_mask_t __C_ctype_b_data[];
+libc_hidden_proto(__C_ctype_b_data)
const __ctype_mask_t __C_ctype_b_data[] = {
#ifdef __UCLIBC_HAS_CTYPE_SIGNED__
/* -128 M-^@ */ 0,
@@ -831,12 +853,16 @@ const __ctype_mask_t __C_ctype_b_data[] = {
/* 254 M-~ */ 0,
/* 255 M-^? */ 0
};
+libc_hidden_def(__C_ctype_b_data)
+libc_hidden_proto(__C_ctype_b)
const __ctype_mask_t *__C_ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET;
+libc_hidden_def(__C_ctype_b)
#ifndef __UCLIBC_HAS_XLOCALE__
const __ctype_mask_t *__ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET;
+libc_hidden_def(__ctype_b)
#endif
@@ -844,6 +870,8 @@ const __ctype_mask_t *__ctype_b = __C_ctype_b_data + __UCLIBC_CTYPE_B_TBL_OFFSET
/**********************************************************************/
#ifdef L___C_ctype_tolower
+extern const __ctype_touplow_t __C_ctype_tolower_data[];
+libc_hidden_proto(__C_ctype_tolower_data)
const __ctype_touplow_t __C_ctype_tolower_data[] = {
#ifdef __UCLIBC_HAS_CTYPE_SIGNED__
-128, -127, -126, -125,
@@ -944,14 +972,19 @@ const __ctype_touplow_t __C_ctype_tolower_data[] = {
248, 249, 250, 251,
252, 253, 254, 255
};
+libc_hidden_def(__C_ctype_tolower_data)
+libc_hidden_proto(__C_ctype_tolower)
const __ctype_touplow_t *__C_ctype_tolower = __C_ctype_tolower_data
+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
+libc_hidden_def(__C_ctype_tolower)
#ifndef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_tolower)
const __ctype_touplow_t *__ctype_tolower = __C_ctype_tolower_data
+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
+libc_hidden_def(__ctype_tolower)
#endif
@@ -959,6 +992,8 @@ const __ctype_touplow_t *__ctype_tolower = __C_ctype_tolower_data
/**********************************************************************/
#ifdef L___C_ctype_toupper
+extern const __ctype_touplow_t __C_ctype_toupper_data[];
+libc_hidden_proto(__C_ctype_toupper_data)
const __ctype_touplow_t __C_ctype_toupper_data[] = {
#ifdef __UCLIBC_HAS_CTYPE_SIGNED__
-128, -127, -126, -125,
@@ -1059,14 +1094,19 @@ const __ctype_touplow_t __C_ctype_toupper_data[] = {
248, 249, 250, 251,
252, 253, 254, 255
};
+libc_hidden_def(__C_ctype_toupper_data)
+libc_hidden_proto(__C_ctype_toupper)
const __ctype_touplow_t *__C_ctype_toupper = __C_ctype_toupper_data
+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
+libc_hidden_def(__C_ctype_toupper)
#ifndef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_toupper)
const __ctype_touplow_t *__ctype_toupper = __C_ctype_toupper_data
+ __UCLIBC_CTYPE_TO_TBL_OFFSET;
+libc_hidden_def(__ctype_toupper)
#endif
diff --git a/libc/misc/error/err.c b/libc/misc/error/err.c
index f27a5e7e8..6c1238ff6 100644
--- a/libc/misc/error/err.c
+++ b/libc/misc/error/err.c
@@ -31,6 +31,7 @@ libc_hidden_proto(vfprintf)
libc_hidden_proto(__xpg_strerror_r)
libc_hidden_proto(exit)
libc_hidden_proto(vfprintf)
+libc_hidden_proto(stderr)
static void vwarn_work(const char *format, va_list args, int showerr)
{
diff --git a/libc/misc/error/error.c b/libc/misc/error/error.c
index 96c5dbe71..6528e28ce 100644
--- a/libc/misc/error/error.c
+++ b/libc/misc/error/error.c
@@ -37,6 +37,8 @@ libc_hidden_proto(vfprintf)
libc_hidden_proto(fflush)
libc_hidden_proto(fputc)
libc_hidden_proto(__fputc_unlocked)
+libc_hidden_proto(stdout)
+libc_hidden_proto(stderr)
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count = 0;
diff --git a/libc/misc/fnmatch/fnmatch.c b/libc/misc/fnmatch/fnmatch.c
index ac7dbcf2b..b70cfd46e 100644
--- a/libc/misc/fnmatch/fnmatch.c
+++ b/libc/misc/fnmatch/fnmatch.c
@@ -68,6 +68,13 @@ libc_hidden_proto(strcmp)
/*libc_hidden_proto(strchrnul)*/
libc_hidden_proto(strlen)
libc_hidden_proto(strcoll)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+libc_hidden_proto(__ctype_tolower_loc)
+#else
+libc_hidden_proto(__ctype_b)
+libc_hidden_proto(__ctype_tolower)
+#endif
libc_hidden_proto(tolower)
libc_hidden_proto(fnmatch)
libc_hidden_proto(getenv)
diff --git a/libc/misc/gnu/obstack.c b/libc/misc/gnu/obstack.c
index 5fc031555..c1ae75869 100644
--- a/libc/misc/gnu/obstack.c
+++ b/libc/misc/gnu/obstack.c
@@ -89,6 +89,7 @@ union fooround {long x; double d;};
abort gracefully or use longjump - but shouldn't return. This
variable by default points to the internal function
`print_and_abort'. */
+libc_hidden_proto(obstack_alloc_failed_handler)
# if defined __STDC__ && __STDC__
static void print_and_abort (void);
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
@@ -96,6 +97,7 @@ void (*obstack_alloc_failed_handler) (void) = print_and_abort;
static void print_and_abort ();
void (*obstack_alloc_failed_handler) () = print_and_abort;
# endif
+libc_hidden_def(obstack_alloc_failed_handler)
/* Exit value used when `print_and_abort' is used. */
@@ -109,11 +111,14 @@ void (*obstack_alloc_failed_handler) () = print_and_abort;
libc_hidden_proto(fprintf)
libc_hidden_proto(abort)
libc_hidden_proto(exit)
+libc_hidden_proto(stderr)
#ifdef __UCLIBC_HAS_WCHAR__
libc_hidden_proto(fwprintf)
#endif
+libc_hidden_proto(obstack_exit_failure)
int obstack_exit_failure = EXIT_FAILURE;
+libc_hidden_def(obstack_exit_failure)
/* The non-GNU-C macros copy the obstack into this global variable
to avoid multiple evaluation. */
diff --git a/libc/misc/internals/__errno_location.c b/libc/misc/internals/__errno_location.c
index 10b97753f..c0146ce68 100644
--- a/libc/misc/internals/__errno_location.c
+++ b/libc/misc/internals/__errno_location.c
@@ -1,8 +1,10 @@
#include <errno.h>
#undef errno
+libc_hidden_proto(errno)
+/* psm: moved to bits/errno.h: libc_hidden_proto(__errno_location) */
int * weak_const_function __errno_location (void)
{
return &errno;
}
-
+#ifdef IS_IN_libc /* not really need, only to keep in sync w/ libc_hidden_proto */
diff --git a/libc/misc/internals/__h_errno_location.c b/libc/misc/internals/__h_errno_location.c
index a57478ca9..1fae93459 100644
--- a/libc/misc/internals/__h_errno_location.c
+++ b/libc/misc/internals/__h_errno_location.c
@@ -3,6 +3,8 @@
#include <netdb.h>
#undef h_errno
+libc_hidden_proto(h_errno)
+
libc_hidden_proto(__h_errno_location)
int * weak_const_function __h_errno_location (void)
{
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 349c0e5d1..7bfe2ccc4 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -89,8 +89,10 @@ strong_alias (__progname_full, program_invocation_name)
* Note: Apparently we must initialize __environ to ensure that the weak
* environ symbol is also included.
*/
+libc_hidden_proto(__environ)
char **__environ = 0;
-weak_alias(__environ, environ)
+libc_hidden_def(__environ)
+strong_alias(__environ,environ)
/* TODO: don't export __pagesize; we cant now because libpthread uses it */
extern size_t __pagesize;
diff --git a/libc/misc/internals/errno.c b/libc/misc/internals/errno.c
index b08478d44..ffacc8188 100644
--- a/libc/misc/internals/errno.c
+++ b/libc/misc/internals/errno.c
@@ -4,6 +4,9 @@
extern int errno;
extern int h_errno;
+libc_hidden_proto(errno)
+libc_hidden_proto(h_errno)
+
#if 0
/* Unfortunately, this doesn't work... */
int h_errno __attribute__ ((section (".bss"))) = 0;
@@ -13,5 +16,7 @@ int _errno = 0;
int _h_errno = 0;
#endif
-weak_alias(_errno, errno)
-weak_alias(_h_errno, h_errno)
+strong_alias(_errno,errno)
+libc_hidden_def(errno)
+strong_alias(_h_errno,h_errno)
+libc_hidden_def(h_errno)
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c
index c32d09722..690e61398 100644
--- a/libc/misc/locale/locale.c
+++ b/libc/misc/locale/locale.c
@@ -70,6 +70,7 @@ libc_hidden_proto(strcpy)
libc_hidden_proto(strncmp)
libc_hidden_proto(strchr)
libc_hidden_proto(getenv)
+libc_hidden_proto(__C_ctype_toupper)
/*libc_hidden_proto(fflush)*/
#ifdef __UCLIBC_MJN3_ONLY__
@@ -149,6 +150,10 @@ extern void _locale_init_l(__locale_t base) attribute_hidden;
#include <langinfo.h>
#include <nl_types.h>
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
+
/**********************************************************************/
#ifdef L_setlocale
@@ -359,12 +364,23 @@ struct lconv *localeconv(void)
/**********************************************************************/
#if defined(L__locale_init) && !defined(__LOCALE_C_ONLY)
+libc_hidden_proto(__C_ctype_b)
+libc_hidden_proto(__C_ctype_tolower)
+#ifndef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b)
+libc_hidden_proto(__ctype_tolower)
+libc_hidden_proto(__ctype_toupper)
+#endif
+
__uclibc_locale_t __global_locale_data;
__locale_t __global_locale = &__global_locale_data;
+libc_hidden_def(__global_locale)
#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__curlocale_var)
__locale_t __curlocale_var = &__global_locale_data;
+libc_hidden_def(__curlocale_var)
#endif
/*----------------------------------------------------------------------*/
@@ -1367,8 +1383,9 @@ void freelocale(__locale_t dataset)
/**********************************************************************/
#ifdef L_uselocale
-libc_hidden_proto(uselocale)
+libc_hidden_proto(__curlocale_var)
+libc_hidden_proto(uselocale)
__locale_t uselocale(__locale_t dataset)
{
__locale_t old;
@@ -1400,6 +1417,8 @@ libc_hidden_def(uselocale)
#ifdef __UCLIBC_HAS_THREADS__
+libc_hidden_proto(__curlocale_var)
+
__locale_t weak_const_function __curlocale(void)
{
return __curlocale_var; /* This is overriden by the thread version. */
diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c
index 864a92821..56737b7bc 100644
--- a/libc/misc/regex/regex.c
+++ b/libc/misc/regex/regex.c
@@ -62,6 +62,13 @@ libc_hidden_proto(wctype)
#define __tolower tolower
#endif
#define __mempcpy mempcpy
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+libc_hidden_proto(__ctype_toupper_loc)
+#else
+libc_hidden_proto(__ctype_b)
+libc_hidden_proto(__ctype_toupper)
+#endif
libc_hidden_proto(toupper)
libc_hidden_proto(tolower)
libc_hidden_proto(memcmp)
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index 626e30140..24eca9e43 100644
--- a/libc/misc/time/time.c
+++ b/libc/misc/time/time.c
@@ -183,6 +183,9 @@ libc_hidden_proto(strncasecmp_l)
libc_hidden_proto(strtol_l)
libc_hidden_proto(strtoul_l)
libc_hidden_proto(nl_langinfo_l)
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
#endif
#ifndef __isleap
@@ -229,7 +232,7 @@ typedef struct {
#ifdef __UCLIBC_HAS_THREADS__
# include <pthread.h>
-extern pthread_mutex_t _time_tzlock;
+extern pthread_mutex_t _time_tzlock attribute_hidden;
#endif
#define TZLOCK __pthread_mutex_lock(&_time_tzlock)
#define TZUNLOCK __pthread_mutex_unlock(&_time_tzlock)
@@ -1701,12 +1704,18 @@ static const char vals[] = {
#define DEFAULT_RULES (vals + 22)
/* Initialize to UTC. */
+libc_hidden_proto(daylight)
int daylight = 0;
+libc_hidden_def(daylight)
+libc_hidden_proto(timezone)
long timezone = 0;
+libc_hidden_def(timezone)
+libc_hidden_proto(tzname)
char *tzname[2] = { (char *) UTC, (char *) (UTC-1) };
+libc_hidden_def(tzname)
#ifdef __UCLIBC_HAS_THREADS__
-pthread_mutex_t _time_tzlock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+attribute_hidden pthread_mutex_t _time_tzlock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
#endif
rule_struct _time_tzinfo[2];
diff --git a/libc/misc/ttyent/getttyent.c b/libc/misc/ttyent/getttyent.c
index c11811769..4388744b2 100644
--- a/libc/misc/ttyent/getttyent.c
+++ b/libc/misc/ttyent/getttyent.c
@@ -50,6 +50,11 @@ libc_hidden_proto(__fgetc_unlocked)
libc_hidden_proto(fopen)
libc_hidden_proto(fclose)
libc_hidden_proto(abort)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
static char zapchar;
static FILE *tf;
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 62a5af704..7beef1595 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -112,6 +112,9 @@
#include <wchar.h>
#include <bits/uClibc_uwchar.h>
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
/**********************************************************************/
#ifdef __UCLIBC_HAS_LOCALE__
#ifdef __UCLIBC_MJN3_ONLY__
@@ -1233,6 +1236,8 @@ enum {
*
*/
+extern const unsigned char __iconv_codesets[];
+libc_hidden_proto(__iconv_codesets)
const unsigned char __iconv_codesets[] =
"\x0a\xe0""WCHAR_T\x00" /* superset of UCS-4 but platform-endian */
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -1265,6 +1270,7 @@ const unsigned char __iconv_codesets[] =
"\x08\x02""UTF-8\x00"
"\x0b\x01""US-ASCII\x00"
"\x07\x01""ASCII"; /* Must be last! (special case to save a nul) */
+libc_hidden_def(__iconv_codesets)
libc_hidden_proto(strcasecmp)
diff --git a/libc/misc/wctype/wctype.c b/libc/misc/wctype/wctype.c
index ad52cd3e7..8f56f4556 100644
--- a/libc/misc/wctype/wctype.c
+++ b/libc/misc/wctype/wctype.c
@@ -39,7 +39,9 @@
#include <bits/uClibc_uwchar.h>
libc_hidden_proto(strcmp)
+libc_hidden_proto(__C_ctype_tolower)
libc_hidden_proto(tolower)
+libc_hidden_proto(__C_ctype_toupper)
libc_hidden_proto(toupper)
libc_hidden_proto(towlower)
libc_hidden_proto(towupper)
@@ -56,7 +58,12 @@ libc_hidden_proto(towlower_l)
libc_hidden_proto(towupper_l)
libc_hidden_proto(towctrans_l)
libc_hidden_proto(iswctype_l)
+#else
+libc_hidden_proto(__ctype_b)
#endif /* __UCLIBC_HAS_XLOCALE__ */
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
/* We know wide char support is enabled. We wouldn't be here otherwise. */
diff --git a/libc/pwd_grp/pwd_grp.c b/libc/pwd_grp/pwd_grp.c
index ea350802c..bf0a65015 100644
--- a/libc/pwd_grp/pwd_grp.c
+++ b/libc/pwd_grp/pwd_grp.c
@@ -51,6 +51,11 @@ libc_hidden_proto(sprintf)
libc_hidden_proto(fopen)
libc_hidden_proto(fclose)
libc_hidden_proto(fprintf)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
/**********************************************************************/
/* Sizes for staticly allocated buffers. */
diff --git a/libc/stdio/_fpmaxtostr.c b/libc/stdio/_fpmaxtostr.c
index 03fe6b1db..8534677f0 100644
--- a/libc/stdio/_fpmaxtostr.c
+++ b/libc/stdio/_fpmaxtostr.c
@@ -12,6 +12,9 @@
#include <bits/uClibc_fpmax.h>
libc_hidden_proto(memset)
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
typedef size_t (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len,
intptr_t buf);
diff --git a/libc/stdio/_stdio.c b/libc/stdio/_stdio.c
index 6454b3f3b..5c8b72086 100644
--- a/libc/stdio/_stdio.c
+++ b/libc/stdio/_stdio.c
@@ -125,12 +125,19 @@ static FILE _stdio_streams[] = {
0 )
};
+/* psm: moved to _stdio.h: libc_hidden_proto(stdin/stdout) */
FILE *stdin = _stdio_streams;
+libc_hidden_def(stdin)
FILE *stdout = _stdio_streams + 1;
+libc_hidden_def(stdout)
+libc_hidden_proto(stderr)
FILE *stderr = _stdio_streams + 2;
+libc_hidden_def(stderr)
#ifdef __STDIO_GETC_MACRO
+libc_hidden_proto(__stdin)
FILE *__stdin = _stdio_streams; /* For getchar() macro. */
+libc_hidden_def(__stdin)
#endif
#ifdef __STDIO_PUTC_MACRO
FILE *__stdout = _stdio_streams + 1; /* For putchar() macro. */
diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h
index d6b68b3bb..7c8176ecc 100644
--- a/libc/stdio/_stdio.h
+++ b/libc/stdio/_stdio.h
@@ -22,6 +22,9 @@
#include <wchar.h>
#endif
+libc_hidden_proto(stdin)
+libc_hidden_proto(stdout)
+
#ifdef __UCLIBC_HAS_THREADS__
#include <pthread.h>
diff --git a/libc/stdio/_uintmaxtostr.c b/libc/stdio/_uintmaxtostr.c
index 4310d6458..f9c83506e 100644
--- a/libc/stdio/_uintmaxtostr.c
+++ b/libc/stdio/_uintmaxtostr.c
@@ -12,6 +12,9 @@
#include <bits/uClibc_uintmaxtostr.h>
libc_hidden_proto(memcpy)
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
/* Avoid using long long / and % operations to cut down dependencies on
* libgcc.a. Definitely helps on i386 at least. */
diff --git a/libc/stdio/gets.c b/libc/stdio/gets.c
index 1c908399c..fd084c90c 100644
--- a/libc/stdio/gets.c
+++ b/libc/stdio/gets.c
@@ -13,6 +13,7 @@ link_warning(gets, "the 'gets' function is dangerous and should not be used.")
libc_hidden_proto(getchar_unlocked)
libc_hidden_proto(__fgetc_unlocked)
+libc_hidden_proto(__stdin)
char *gets(char *s)
{
diff --git a/libc/stdio/perror.c b/libc/stdio/perror.c
index 993fcf428..2c3cbbdb5 100644
--- a/libc/stdio/perror.c
+++ b/libc/stdio/perror.c
@@ -9,6 +9,7 @@
libc_hidden_proto(fprintf)
libc_hidden_proto(__glibc_strerror_r)
+libc_hidden_proto(stderr)
#ifdef __UCLIBC_MJN3_ONLY__
#warning CONSIDER: Increase buffer size for error message (non-%m case)?
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c
index 4b1fd0681..cfe52d94f 100644
--- a/libc/stdio/scanf.c
+++ b/libc/stdio/scanf.c
@@ -99,6 +99,14 @@ libc_hidden_proto(ungetwc)
libc_hidden_proto(iswspace)
libc_hidden_proto(fgetwc_unlocked)
#endif
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
+libc_hidden_proto(__ctype_b)
+#endif
#ifdef __UCLIBC_HAS_SCANF_GLIBC_A_FLAG__
#ifdef L_vfscanf
diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c
index d467b8297..7794c6e39 100644
--- a/libc/stdio/vfprintf.c
+++ b/libc/stdio/vfprintf.c
@@ -513,6 +513,10 @@ size_t parse_printf_format(register const char *template,
/**********************************************************************/
#ifdef L__ppfs_init
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
+
int attribute_hidden _ppfs_init(register ppfs_t *ppfs, const char *fmt0)
{
int r;
@@ -731,6 +735,12 @@ void attribute_hidden _ppfs_setargs(register ppfs_t *ppfs)
/**********************************************************************/
#ifdef L__ppfs_parsespec
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
+
/* Notes: argtype differs from glibc for the following:
* mine glibc
* lc PA_WCHAR PA_CHAR the standard says %lc means %C
@@ -1245,6 +1255,10 @@ static size_t _fp_out_narrow(FILE *fp, intptr_t type, intptr_t len, intptr_t buf
#define _outnwcs(stream, wstring, len) _wstdio_fwrite(wstring, len, stream)
#define FP_OUT _fp_out_wide
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
+
static size_t _outnstr(FILE *stream, const char *s, size_t wclen)
{
/* NOTE!!! len here is the number of wchars we want to generate!!! */
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index c27872f02..4289c72b5 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -66,7 +66,7 @@ typedef enum {
} ef_type; /* exit function types */
/* this is in the L_exit object */
-extern void (*__exit_cleanup) (int);
+extern void (*__exit_cleanup) (int) attribute_hidden;
/* these are in the L___do_exit object */
extern int __exit_slots attribute_hidden;
@@ -309,7 +309,7 @@ void __exit_handler(int status)
#ifdef L_exit
extern void weak_function _stdio_term(void) attribute_hidden;
-void (*__exit_cleanup) (int) = 0;
+attribute_hidden void (*__exit_cleanup) (int) = 0;
#ifdef __UCLIBC_HAS_THREADS__
pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
#endif
diff --git a/libc/stdlib/getenv.c b/libc/stdlib/getenv.c
index c7940f398..4f4c4f1f8 100644
--- a/libc/stdlib/getenv.c
+++ b/libc/stdlib/getenv.c
@@ -11,6 +11,7 @@
libc_hidden_proto(getenv)
libc_hidden_proto(memcmp)
libc_hidden_proto(strlen)
+libc_hidden_proto(__environ)
/* IEEE Std 1003.1-2001 says getenv need not be thread safe, so
* don't bother locking access to __environ */
diff --git a/libc/stdlib/malloc-standard/mallinfo.c b/libc/stdlib/malloc-standard/mallinfo.c
index 4f274ed32..89c9a6e7e 100644
--- a/libc/stdlib/malloc-standard/mallinfo.c
+++ b/libc/stdlib/malloc-standard/mallinfo.c
@@ -17,6 +17,7 @@
#include "malloc.h"
libc_hidden_proto(fprintf)
+libc_hidden_proto(stderr)
/* ------------------------------ mallinfo ------------------------------ */
libc_hidden_proto(mallinfo)
diff --git a/libc/stdlib/setenv.c b/libc/stdlib/setenv.c
index 347718237..3b02cec43 100644
--- a/libc/stdlib/setenv.c
+++ b/libc/stdlib/setenv.c
@@ -32,6 +32,7 @@ libc_hidden_proto(strlen)
libc_hidden_proto(strncmp)
libc_hidden_proto(strndup)
libc_hidden_proto(unsetenv)
+libc_hidden_proto(__environ)
#ifdef __UCLIBC_HAS_THREADS__
# include <pthread.h>
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index 2ff404621..10e5054cc 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -86,6 +86,9 @@ libc_hidden_proto(iswspace)
#ifdef __UCLIBC_HAS_XLOCALE__
#include <xlocale.h>
#endif /* __UCLIBC_HAS_XLOCALE__ */
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
/* TODO: clean up the following... */
@@ -476,6 +479,12 @@ unsigned long attribute_hidden _stdlib_strto_l(register const Wchar * __restrict
/* This is the main work fuction which handles both strtol (sflag = 1) and
* strtoul (sflag = 0). */
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
+
unsigned long attribute_hidden __XL_NPP(_stdlib_strto_l)(register const Wchar * __restrict str,
Wchar ** __restrict endptr, int base,
int sflag __LOCALE_PARAM )
@@ -618,6 +627,9 @@ unsigned long long attribute_hidden _stdlib_strto_ll(register const Wchar * __re
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
+#ifndef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b)
+#endif
/* This is the main work fuction which handles both strtoll (sflag = 1) and
* strtoull (sflag = 0). */
diff --git a/libc/stdlib/strtod.c b/libc/stdlib/strtod.c
index 3fd63ac6f..b0dfad62a 100644
--- a/libc/stdlib/strtod.c
+++ b/libc/stdlib/strtod.c
@@ -176,6 +176,16 @@ extern void __fp_range_check(__fpmax_t y, __fpmax_t x) attribute_hidden;
/**********************************************************************/
#if defined(L___strtofpmax) || defined(L___strtofpmax_l) || defined(L___wcstofpmax) || defined(L___wcstofpmax_l)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+#ifdef __UCLIBC_HAS_LOCALE__
+libc_hidden_proto(__global_locale)
+#endif
+libc_hidden_proto(__ctype_b)
+libc_hidden_proto(__ctype_tolower)
+#endif
+
#if defined(L___wcstofpmax) || defined(L___wcstofpmax_l)
#define __strtofpmax __wcstofpmax
diff --git a/libc/string/_collate.c b/libc/string/_collate.c
index 3009e4ebf..42216e9e4 100644
--- a/libc/string/_collate.c
+++ b/libc/string/_collate.c
@@ -57,6 +57,8 @@ libc_hidden_proto(wcscmp)
#endif /* defined(L_strxfrm) || defined(L_strxfrm_l) */
+libc_hidden_proto(__global_locale)
+
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
libc_hidden_proto(wcscoll_l)
diff --git a/libc/string/psignal.c b/libc/string/psignal.c
index daf9764b1..64b52c98b 100644
--- a/libc/string/psignal.c
+++ b/libc/string/psignal.c
@@ -12,6 +12,7 @@
libc_hidden_proto(fprintf)
libc_hidden_proto(strsignal)
+libc_hidden_proto(stderr)
/* TODO: make this threadsafe with a reentrant version of strsignal? */
diff --git a/libc/string/strcasecmp.c b/libc/string/strcasecmp.c
index 333d3159c..ac3f562a7 100644
--- a/libc/string/strcasecmp.c
+++ b/libc/string/strcasecmp.c
@@ -24,6 +24,9 @@ libc_hidden_proto(towlower)
libc_hidden_proto(tolower_l)
# define TOLOWER(C) tolower_l((C), locale_arg)
# else
+#ifndef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_tolower)
+#endif
libc_hidden_proto(tolower)
# define TOLOWER(C) tolower((C))
# endif
diff --git a/libc/string/strcasestr.c b/libc/string/strcasestr.c
index d835440ec..72c1e4702 100644
--- a/libc/string/strcasestr.c
+++ b/libc/string/strcasestr.c
@@ -8,6 +8,11 @@
#include "_string.h"
#include <ctype.h>
+#ifndef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_tolower)
+#else
+libc_hidden_proto(__ctype_tolower_loc)
+#endif
libc_hidden_proto(tolower)
char *strcasestr(const char *s1, const char *s2)
diff --git a/libc/string/strncasecmp.c b/libc/string/strncasecmp.c
index 2133b4ebd..54de1b78c 100644
--- a/libc/string/strncasecmp.c
+++ b/libc/string/strncasecmp.c
@@ -24,6 +24,9 @@ libc_hidden_proto(towlower)
libc_hidden_proto(tolower_l)
# define TOLOWER(C) tolower_l((C), locale_arg)
# else
+#ifndef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_tolower)
+#endif
libc_hidden_proto(tolower)
# define TOLOWER(C) tolower((C))
# endif
diff --git a/libc/sysdeps/linux/common/bits/errno.h b/libc/sysdeps/linux/common/bits/errno.h
index bd8b1d4b8..679600e5e 100644
--- a/libc/sysdeps/linux/common/bits/errno.h
+++ b/libc/sysdeps/linux/common/bits/errno.h
@@ -38,6 +38,9 @@ extern int errno;
extern int *__errno_location (void) __THROW __attribute__ ((__const__));
# if defined _LIBC
+#ifdef IS_IN_libc
+libc_hidden_proto(__errno_location)
+#endif
/* We wouldn't need a special macro anymore but it is history. */
# define __set_errno(val) ((errno) = (val))
# endif /* _LIBC */
diff --git a/libc/unistd/exec.c b/libc/unistd/exec.c
index 08ef742d3..04549dd40 100644
--- a/libc/unistd/exec.c
+++ b/libc/unistd/exec.c
@@ -51,6 +51,7 @@ libc_hidden_proto(execve)
libc_hidden_proto(mmap)
libc_hidden_proto(munmap)
libc_hidden_proto(getenv)
+libc_hidden_proto(__environ)
/**********************************************************************/
#if defined(__ARCH_HAS_MMU__) || defined(__UCLIBC_UCLINUX_BROKEN_MUNMAP__)
diff --git a/libc/unistd/getopt.c b/libc/unistd/getopt.c
index d9c458595..514187995 100644
--- a/libc/unistd/getopt.c
+++ b/libc/unistd/getopt.c
@@ -34,13 +34,6 @@
#include <libintl.h>
#endif
-libc_hidden_proto(strchr)
-libc_hidden_proto(strcmp)
-libc_hidden_proto(strlen)
-libc_hidden_proto(strncmp)
-libc_hidden_proto(getenv)
-libc_hidden_proto(fprintf)
-
#ifdef __UCLIBC_MJN3_ONLY__
#warning TODO: Enable gettext awareness.
#endif /* __UCLIBC_MJN3_ONLY__ */
@@ -66,7 +59,19 @@ libc_hidden_proto(fprintf)
GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */
-#include "getopt.h"
+#include <getopt.h>
+
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strncmp)
+libc_hidden_proto(getenv)
+libc_hidden_proto(fprintf)
+libc_hidden_proto(optarg)
+libc_hidden_proto(opterr)
+libc_hidden_proto(optind)
+libc_hidden_proto(optopt)
+libc_hidden_proto(stderr)
extern int _getopt_internal (int argc, char *const *argv, const char *optstring,
const struct option *longopts, int *longind, int long_only) attribute_hidden;
@@ -79,6 +84,7 @@ extern int _getopt_internal (int argc, char *const *argv, const char *optstring,
each non-option ARGV-element is returned here. */
char *optarg = NULL;
+libc_hidden_def(optarg)
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
@@ -94,17 +100,20 @@ char *optarg = NULL;
/* 1003.2 says this must be 1 before any call. */
int optind = 1;
+libc_hidden_def(optind)
/* Callers store zero here to inhibit the error message
for unrecognized options. */
int opterr = 1;
+libc_hidden_def(opterr)
/* Set to an option character which was unrecognized.
This must be initialized on some systems to avoid linking in the
system's own getopt implementation. */
int optopt = '?';
+libc_hidden_def(optopt)
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
diff --git a/libc/unistd/getpass.c b/libc/unistd/getpass.c
index 5833bc317..455838c62 100644
--- a/libc/unistd/getpass.c
+++ b/libc/unistd/getpass.c
@@ -35,6 +35,8 @@ libc_hidden_proto(fputs)
libc_hidden_proto(fputc)
libc_hidden_proto(putc)
libc_hidden_proto(__fputc_unlocked)
+libc_hidden_proto(stdin)
+libc_hidden_proto(stderr)
/* It is desirable to use this bit on systems that have it.
The only bit of terminal state we want to twiddle is echoing, which is
diff --git a/libc/unistd/usershell.c b/libc/unistd/usershell.c
index 51330ae78..ab84fe9f5 100644
--- a/libc/unistd/usershell.c
+++ b/libc/unistd/usershell.c
@@ -47,6 +47,11 @@ libc_hidden_proto(fclose)
libc_hidden_proto(__fsetlocking)
libc_hidden_proto(fileno)
libc_hidden_proto(fgets_unlocked)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
/*
* Local shells should NOT be added here. They should be added in