diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-16 18:07:18 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-16 18:07:18 +0000 |
commit | b25ad630be8b0f362fea44a97efbead83d1dd2ae (patch) | |
tree | 6f45eed6bf053c9e105d6b67bc1d765b49b58e61 | |
parent | e4a6dbb41c73cf86b95beca2d0e2bb6f0530ef79 (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 ;-)
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; |