The __uc_malloc patch was a bit sloppy about the libc_hidden_proto
conventions in uClibc; as a result, more relocations than necessary are
generated for libc.so.  The patch below fixes that.

Before I apply this, I wanted to start a discussion about whether
__uc_malloc is a good idea at all.  Space savings are all well and good,
but these come at a cost in reliability.  A number of libc functions can
now call exit, even though this is not documented and not expected by
any programs that call them.

Personally, I think all the __uc_malloc patches should be reverted.
Comments?


Bernd
-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
Index: libc/inet/getproto.c
===================================================================
--- libc/inet/getproto.c	(revision 20958)
+++ libc/inet/getproto.c	(working copy)
@@ -70,6 +70,7 @@ libc_hidden_proto(rewind)
 libc_hidden_proto(fgets)
 libc_hidden_proto(fclose)
 libc_hidden_proto(abort)
+libc_hidden_proto(__uc_malloc)
 
 #include <bits/uClibc_mutex.h>
 __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
Index: libc/inet/getnetent.c
===================================================================
--- libc/inet/getnetent.c	(revision 20958)
+++ libc/inet/getnetent.c	(working copy)
@@ -29,6 +29,8 @@ libc_hidden_proto(inet_network)
 libc_hidden_proto(rewind)
 libc_hidden_proto(fgets)
 libc_hidden_proto(abort)
+libc_hidden_proto(__uc_malloc)
+
 
 #include <bits/uClibc_mutex.h>
 __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
Index: libc/inet/rpc/ruserpass.c
===================================================================
--- libc/inet/rpc/ruserpass.c	(revision 20958)
+++ libc/inet/rpc/ruserpass.c	(working copy)
@@ -65,6 +65,7 @@ libc_hidden_proto(fopen)
 libc_hidden_proto(fclose)
 libc_hidden_proto(getc_unlocked)
 libc_hidden_proto(__fgetc_unlocked)
+libc_hidden_proto(__uc_malloc)
 
 #define _(X)  (X)
 /* #include "ftp_var.h" */
Index: libc/inet/resolv.c
===================================================================
--- libc/inet/resolv.c	(revision 20958)
+++ libc/inet/resolv.c	(working copy)
@@ -221,6 +221,7 @@ libc_hidden_proto(__ctype_b_loc)
 #elif __UCLIBC_HAS_CTYPE_TABLES__
 libc_hidden_proto(__ctype_b)
 #endif
+libc_hidden_proto(__uc_malloc)
 
 
 
Index: libc/inet/getservice.c
===================================================================
--- libc/inet/getservice.c	(revision 20958)
+++ libc/inet/getservice.c	(working copy)
@@ -72,6 +72,7 @@ libc_hidden_proto(atoi)
 libc_hidden_proto(rewind)
 libc_hidden_proto(fgets)
 libc_hidden_proto(abort)
+libc_hidden_proto(__uc_malloc)
 
 #include <bits/uClibc_mutex.h>
 __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
Index: libc/stdlib/__uc_malloc.c
===================================================================
--- libc/stdlib/__uc_malloc.c	(revision 20958)
+++ libc/stdlib/__uc_malloc.c	(working copy)
@@ -22,6 +22,7 @@ Cambridge, MA 02139, USA.
 #include <unistd.h>
 #include <malloc.h>
 
+libc_hidden_proto(_exit);
 libc_hidden_proto(__uc_malloc);
 libc_hidden_proto(__uc_malloc_failed);
 
Index: libc/pwd_grp/pwd_grp.c
===================================================================
--- libc/pwd_grp/pwd_grp.c	(revision 20958)
+++ libc/pwd_grp/pwd_grp.c	(working copy)
@@ -54,6 +54,7 @@ libc_hidden_proto(__ctype_b_loc)
 #elif __UCLIBC_HAS_CTYPE_TABLES__
 libc_hidden_proto(__ctype_b)
 #endif
+libc_hidden_proto(__uc_malloc)
 
 /**********************************************************************/
 /* Prototypes for internal functions. */
Index: libc/unistd/getpass.c
===================================================================
--- libc/unistd/getpass.c	(revision 20958)
+++ libc/unistd/getpass.c	(working copy)
@@ -37,6 +37,7 @@ libc_hidden_proto(fputs)
 libc_hidden_proto(fputc)
 libc_hidden_proto(putc)
 libc_hidden_proto(__fputc_unlocked)
+libc_hidden_proto(__uc_malloc)
 
 /* 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
Index: libc/misc/utmp/utent.c
===================================================================
--- libc/misc/utmp/utent.c	(revision 20958)
+++ libc/misc/utmp/utent.c	(working copy)
@@ -30,6 +30,7 @@ libc_hidden_proto(open)
 libc_hidden_proto(fcntl)
 libc_hidden_proto(close)
 libc_hidden_proto(lseek)
+libc_hidden_proto(__uc_malloc)
 
 #include <bits/uClibc_mutex.h>
 __UCLIBC_MUTEX_STATIC(utmplock, PTHREAD_MUTEX_INITIALIZER);
Index: libc/misc/ttyent/getttyent.c
===================================================================
--- libc/misc/ttyent/getttyent.c	(revision 20958)
+++ libc/misc/ttyent/getttyent.c	(working copy)
@@ -55,6 +55,7 @@ libc_hidden_proto(__ctype_b_loc)
 #elif __UCLIBC_HAS_CTYPE_TABLES__
 libc_hidden_proto(__ctype_b)
 #endif
+libc_hidden_proto(__uc_malloc)
 
 static char zapchar;
 static FILE *tf;
Index: libc/misc/mntent/mntent.c
===================================================================
--- libc/misc/mntent/mntent.c	(revision 20958)
+++ libc/misc/mntent/mntent.c	(working copy)
@@ -26,6 +26,7 @@ libc_hidden_proto(fseek)
 libc_hidden_proto(fgets)
 libc_hidden_proto(abort)
 libc_hidden_proto(fprintf)
+libc_hidden_proto(__uc_malloc)
 
 /* Reentrant version of getmntent.  */
 struct mntent *getmntent_r (FILE *filep, 
Index: libc/misc/regex/regex_old.c
===================================================================
--- libc/misc/regex/regex_old.c	(revision 20958)
+++ libc/misc/regex/regex_old.c	(working copy)
@@ -48,6 +48,7 @@ libc_hidden_proto(abort)
 #ifdef __USE_GNU
 libc_hidden_proto(mempcpy)
 #endif
+libc_hidden_proto(__uc_malloc)
 
 /* AIX requires this to be the first thing in the file. */
 #if defined _AIX && !defined REGEX_MALLOC
_______________________________________________
uClibc mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Reply via email to