[git commit future 1/1] wchar.c, iconv.c: do not include __iconv_codesets into iconv utility
Peter S. Mazinger
ps.m at gmx.net
Thu Mar 10 12:15:10 UTC 2011
commit: http://git.uclibc.org/uClibc/commit/?id=ad7a3878c789a15dd50e74799a02af7eef37a723
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
If __iconv_codesets[] is static (ending up in both libc and iconv)
text data bss dec hex filename
491818 2346 20872 515036 7dbdc lib/libuClibc-0.9.32-rc2-git.so
3804 324 16 4144 1030 utils/iconv
If __iconv_codesets[] is hidden and is not included in iconv
text data bss dec hex filename
491855 2346 20872 515073 7dc01 lib/libuClibc-0.9.32-rc2-git.so
3693 328 16 4037 fc5 utils/iconv
The overall win is better this way
Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
libc/misc/wchar/wchar.c | 4 ----
utils/iconv.c | 2 +-
2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index ab6c617..c0c9331 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -1193,9 +1193,7 @@ typedef struct {
/* Used externally only by iconv utility */
extern const unsigned char __iconv_codesets[];
libc_hidden_proto(__iconv_codesets)
-#endif
-#if defined L_iconv || defined L_iconv_main
const unsigned char __iconv_codesets[] =
"\x0a\xe0""WCHAR_T\x00" /* superset of UCS-4 but platform-endian */
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -1228,8 +1226,6 @@ 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) */
-#endif
-#if defined L_iconv && defined _LIBC
libc_hidden_data_def(__iconv_codesets)
#endif
diff --git a/utils/iconv.c b/utils/iconv.c
index 589c64c..844320a 100644
--- a/utils/iconv.c
+++ b/utils/iconv.c
@@ -104,7 +104,7 @@
#include <stdarg.h>
#include <libgen.h>
#include <wchar.h>
-#include "wchar.c" /* for _UC_iconv_t and __iconv_codesets */
+#include "wchar.c" /* for _UC_iconv_t and __LOCALE_DATA_CODESET_LIST */
extern const unsigned char __iconv_codesets[];
--
1.7.3.4
More information about the uClibc-cvs
mailing list