OSDN Git Service

uclinux-h8/uClibc.git
15 years agodocs/defines.txt: document _extern_inline
Denis Vlasenko [Mon, 22 Dec 2008 01:01:40 +0000 (01:01 -0000)]
docs/defines.txt: document _extern_inline
libc/inet/ether_addr.c: optimize tolower, we ever use it on 0-9a-f
libc/inet/ntop.c: optimize tolower, we ever use it on 0-9a-f
 with locale support on, code size change is:

    text           data     bss     dec     hex filename
-    396              0      24     420     1a4 libc/inet/ether_addr.os
+    306              0      24     330     14a libc/inet/ether_addr.os
-   1453              0       0    1453     5ad libc/inet/ntop.os
+   1430              0       0    1430     596 libc/inet/ntop.os

15 years agomore of warning fixes, mostly pointer signedness mismatches
Denis Vlasenko [Sun, 21 Dec 2008 14:50:55 +0000 (14:50 -0000)]
more of warning fixes, mostly pointer signedness mismatches

15 years agomore of pointer signedness warnings removed
Denis Vlasenko [Sun, 21 Dec 2008 14:12:08 +0000 (14:12 -0000)]
more of pointer signedness warnings removed

15 years agoheed multiple warnings of the type
Denis Vlasenko [Sun, 21 Dec 2008 13:27:02 +0000 (13:27 -0000)]
heed multiple warnings of the type
 libc/stdio/_vfprintf.c:1892: warning: passing argument 1
 of '_[w]stdio_fwrite' from incompatible pointer type

15 years agolibc/stdio/_scanf.c: heed lots of warnings about signed/unsigned chars
Denis Vlasenko [Sat, 20 Dec 2008 17:35:25 +0000 (17:35 -0000)]
libc/stdio/_scanf.c: heed lots of warnings about signed/unsigned chars
 and such; remove two unneeded static string (inline "str" works better
 code-size wise).

15 years agoextra/locale/locale_mmap.h: fix broken whitespace
Denis Vlasenko [Sat, 20 Dec 2008 16:54:46 +0000 (16:54 -0000)]
extra/locale/locale_mmap.h: fix broken whitespace

15 years agolibc/misc/locale/locale.c: heed a pile of warnings
Denis Vlasenko [Sat, 20 Dec 2008 16:33:54 +0000 (16:33 -0000)]
libc/misc/locale/locale.c: heed a pile of warnings
 from signed/unsigned char conversions

15 years agolibc/misc/locale/locale.c: remove one unneeded static data,
Denis Vlasenko [Sat, 20 Dec 2008 16:08:45 +0000 (16:08 -0000)]
libc/misc/locale/locale.c: remove one unneeded static data,
 rewrite one exceptionally unreadable loop. Heed a few warnings
 (wrong type for string op params)

    text           data     bss     dec     hex filename
-   1164             16       0    1180     49c libc/misc/locale/newlocale.os
+   1180              0       0    1180     49c libc/misc/locale/newlocale.os
- 494480           2751   15684  512915   7d393 lib/libuClibc-0.9.30-svn.so
+ 494472           2735   15684  512891   7d37b lib/libuClibc-0.9.30-svn.so

15 years agoDeal with a few data fields which may be made constant.
Denis Vlasenko [Sat, 20 Dec 2008 15:25:51 +0000 (15:25 -0000)]
Deal with a few data fields which may be made constant.

    text           data     bss     dec     hex filename
-   1237              9      28    1274     4fa libc/inet/rpc/getrpcent.os
+   1246              0      28    1274     4fa libc/inet/rpc/getrpcent.os
-    773             24       0     797     31d libc/misc/time/_time_localtime_tzi.os
+    772             16       0     788     314 libc/misc/time/_time_localtime_tzi.os

15 years agolibc/string/i386/rawmemchr.c: i386 version, adapted from strlen()
Denis Vlasenko [Sat, 20 Dec 2008 14:34:19 +0000 (14:34 -0000)]
libc/string/i386/rawmemchr.c: i386 version, adapted from strlen()
libc/string/i386/strlen.c: small optimization, same code size)

    text           data     bss     dec     hex filename
- 240449           1759   11960  254168   3e0d8 lib/libuClibc-0.9.30-svn.so
+ 240339           1759   11960  254058   3e06a lib/libuClibc-0.9.30-svn.so

15 years agostring/i386/strncpy.c: fixlet for testing code
Denis Vlasenko [Sat, 20 Dec 2008 01:54:55 +0000 (01:54 -0000)]
string/i386/strncpy.c: fixlet for testing code
string/i386/strchrnul.c: new function, adapted from strchr.c

    text           data     bss     dec     hex filename
- 240604           1759   11960  254323   3e173 lib/libuClibc-0.9.30-svn.so
+ 240449           1759   11960  254168   3e0d8 lib/libuClibc-0.9.30-svn.so

15 years agostring/i386/strncpy: faster i386 version (same code size), testing code
Denis Vlasenko [Sat, 20 Dec 2008 01:34:52 +0000 (01:34 -0000)]
string/i386/strncpy: faster i386 version (same code size), testing code
string/i386/*: formatiing and commentary tidying up

15 years agostrchr: a bit faster version for i386 (same code size)
Denis Vlasenko [Fri, 19 Dec 2008 15:10:25 +0000 (15:10 -0000)]
strchr: a bit faster version for i386 (same code size)

15 years agomemmove: smaller one for i386, with added testing, and with
Denis Vlasenko [Fri, 19 Dec 2008 14:45:51 +0000 (14:45 -0000)]
memmove: smaller one for i386, with added testing, and with
 added check for src == dest. run tested.

    text           data     bss     dec     hex filename
-     39              0       0      39      27 libc/string/i386/memmove.os
+     37              0       0      37      25 libc/string/i386/memmove.os

15 years agostrncat: shorter version for i386, add small embedded test
Denis Vlasenko [Fri, 19 Dec 2008 13:51:38 +0000 (13:51 -0000)]
strncat: shorter version for i386, add small embedded test
memchr: add small embedded test
strnlen: make small embedded test easier to use
strncmp: reformat assembly to make it readable, no code changes
 (verified with objdump)

    text           data     bss     dec     hex filename
-     46              0       0      46      2e libc/string/i386/strncat.os
+     39              0       0      39      27 libc/string/i386/strncat.os

15 years agoremove one forgotten '##'. Heeds:
Denis Vlasenko [Fri, 19 Dec 2008 04:26:16 +0000 (04:26 -0000)]
remove one forgotten '##'. Heeds:
warning: type defaults to 'int' in declaration of 'intfcntl'

15 years agostring/i386: smaller, and hopefully easier to read, strnlen().
Denis Vlasenko [Fri, 19 Dec 2008 00:25:56 +0000 (00:25 -0000)]
string/i386: smaller, and hopefully easier to read, strnlen().

    text           data     bss     dec     hex filename
-     25              0       0      25      19 libc/string/i386/strnlen.os
+     24              0       0      24      18 libc/string/i386/strnlen.os

15 years agofix for build failures resulting from "string ops for i386" change
Denis Vlasenko [Wed, 17 Dec 2008 22:17:17 +0000 (22:17 -0000)]
fix for build failures resulting from "string ops for i386" change

15 years ago- provide INTERNAL_SYSCALL for ia64 (Stefan Assmann, sassmann at suse de)
Bernhard Reutner-Fischer [Wed, 17 Dec 2008 16:01:39 +0000 (16:01 -0000)]
- provide INTERNAL_SYSCALL for ia64 (Stefan Assmann, sassmann at suse de)

15 years agosince gcc -Os hates us and does not inline string ops,
Denis Vlasenko [Wed, 17 Dec 2008 01:36:31 +0000 (01:36 -0000)]
since gcc -Os hates us and does not inline string ops,
implement inline versions of some of them.
Enable only those which result roughly in the same
code size as using out-or-line versions.

None of this affects users, installed headers won't have
any trace of it.

15 years agomemchr: smaller i386 version
Denis Vlasenko [Wed, 17 Dec 2008 01:31:29 +0000 (01:31 -0000)]
memchr: smaller i386 version
strrchr: smaller i386 version

    text           data     bss     dec     hex filename
-     33              0       0      33      21 libc/string/i386/memchr.o
+     28              0       0      28      1c libc/string/i386/memchr.o
-     31              0       0      31      1f libc/string/i386/strrchr.o
+     26              0       0      26      1a libc/string/i386/strrchr.o

15 years agoresolv: fix testcase failure
Denis Vlasenko [Wed, 17 Dec 2008 01:28:36 +0000 (01:28 -0000)]
resolv: fix testcase failure
test/regex/tst-regex2.c: fix testcase to compile with just "gcc <file>.c"

15 years ago- emulate unavailable syscall getpgrp on e.g. ia64 (Stefan Assmann)
Bernhard Reutner-Fischer [Tue, 16 Dec 2008 15:40:15 +0000 (15:40 -0000)]
- emulate unavailable syscall getpgrp on e.g. ia64 (Stefan Assmann)

15 years ago- install utils into the proper directories
Bernhard Reutner-Fischer [Tue, 16 Dec 2008 13:55:57 +0000 (13:55 -0000)]
- install utils into the proper directories

15 years agofix testing "gcc -mpreferred-stack-boundary=2" on x86_64
Denis Vlasenko [Tue, 16 Dec 2008 07:48:29 +0000 (07:48 -0000)]
fix testing "gcc -mpreferred-stack-boundary=2" on x86_64

15 years agoRemove __libc_posix_fadvise[64] alias. It existed on i386 and arm only,
Denis Vlasenko [Mon, 15 Dec 2008 21:34:59 +0000 (21:34 -0000)]
Remove __libc_posix_fadvise[64] alias. It existed on i386 and arm only,
 and google says only uclibc has it, no users at all.

    text           data     bss     dec     hex filename
- 229374           1367   11280  242021   3b165 lib/libuClibc-0.9.30-svn.so
+ 229347           1367   11280  241994   3b14a lib/libuClibc-0.9.30-svn.so

15 years agoremove some duplicates in bits/signum.h. No code changes.
Denis Vlasenko [Mon, 15 Dec 2008 09:49:15 +0000 (09:49 -0000)]
remove some duplicates in bits/signum.h. No code changes.

 include/signal.h                        |   42 +++++++++++++++++++-------------
 libc/sysdeps/linux/alpha/bits/signum.h  |   19 --------------
 libc/sysdeps/linux/common/bits/signum.h |   22 ----------------
 libc/sysdeps/linux/hppa/bits/signum.h   |   17 ------------
 libc/sysdeps/linux/mips/bits/signum.h   |   23 +----------------
 libc/sysdeps/linux/sparc/bits/signum.h  |   20 ---------------
 6 files changed, 27 insertions(+), 116 deletions(-)

15 years agosigaction overhaul as described in docs/sigaction.txt
Denis Vlasenko [Mon, 15 Dec 2008 09:29:33 +0000 (09:29 -0000)]
sigaction overhaul as described in docs/sigaction.txt
Run tested on i386.

15 years agoheed compiler warnings about checking non-defined variables in #if directives
Denis Vlasenko [Sun, 14 Dec 2008 16:04:01 +0000 (16:04 -0000)]
heed compiler warnings about checking non-defined variables in #if directives

15 years agoAdd proposed plan of sanitizing sigaction to docs/*
Denis Vlasenko [Sun, 14 Dec 2008 03:39:28 +0000 (03:39 -0000)]
Add proposed plan of sanitizing sigaction to docs/*

15 years agoRemove the rest of "bounded pointers" scaffolding. gcc website says"
Denis Vlasenko [Sat, 13 Dec 2008 21:11:40 +0000 (21:11 -0000)]
Remove the rest of "bounded pointers" scaffolding. gcc website says"
"Bounds Checking Projects... This project has been abandoned"
for four years at least.

15 years agofeatures.h: add TODO (changing __OPTIMIZE_SIZE__ is a wrong thing to do)
Denis Vlasenko [Sat, 13 Dec 2008 15:21:07 +0000 (15:21 -0000)]
features.h: add TODO (changing __OPTIMIZE_SIZE__ is a wrong thing to do)

15 years agodoc snippets about defines we provide and/or use
Denis Vlasenko [Sat, 13 Dec 2008 15:02:30 +0000 (15:02 -0000)]
doc snippets about defines we provide and/or use

15 years agoDo not install libc-XXXX.h files in "make install".
Denis Vlasenko [Sat, 13 Dec 2008 12:43:23 +0000 (12:43 -0000)]
Do not install libc-XXXX.h files in "make install".
 glibc does not have them, so should be safe.

15 years agomake all "XXXhidden_proto(" consistently not use a space before '('
Denis Vlasenko [Sat, 13 Dec 2008 12:37:04 +0000 (12:37 -0000)]
make all "XXXhidden_proto(" consistently not use a space before '('

15 years agoMake it again possible to have compact and small stack usage
Denis Vlasenko [Sat, 13 Dec 2008 03:34:47 +0000 (03:34 -0000)]
Make it again possible to have compact and small stack usage
on non-SSE capable processors. I'm doing it the second time.

   text    data     bss     dec     hex filename
 238539    1367   11280  251186   3d532 uClibc.z2/lib/libuClibc-0.9.30-svn.so
 229457    1367   11280  242104   3b1b8 uClibc.z3/lib/libuClibc-0.9.30-svn.so

15 years agostring/generic/memcmp.c: remove some really paranoid guards
Denis Vlasenko [Sat, 13 Dec 2008 03:00:59 +0000 (03:00 -0000)]
string/generic/memcmp.c: remove some really paranoid guards
 for ancient compilers. none of other string/*.c files have them.

15 years ago*: document __USE_EXTERN_INLINES better;
Denis Vlasenko [Sat, 13 Dec 2008 01:53:28 +0000 (01:53 -0000)]
*: document __USE_EXTERN_INLINES better;
 fix uclibc build if it is forcibly enabled

15 years agoi386/brk.c: gcc can't figure out how to use %ebx in PIC mode,
Denis Vlasenko [Fri, 12 Dec 2008 23:34:42 +0000 (23:34 -0000)]
i386/brk.c: gcc can't figure out how to use %ebx in PIC mode,
 help it. Code size is the same.

15 years ago- only strip if cc compiled fine
Bernhard Reutner-Fischer [Fri, 12 Dec 2008 15:21:51 +0000 (15:21 -0000)]
- only strip if cc compiled fine
  Avoids displaying an additional error from strip when your cc ICEs or
  fails otherwise.

15 years ago*: remove vestiges of gcc's "bounded pointers" feature,
Denis Vlasenko [Fri, 12 Dec 2008 14:48:10 +0000 (14:48 -0000)]
*: remove vestiges of gcc's "bounded pointers" feature,
 it is dead (not supported by gcc) for years.
 (more of it remains in multiple copies of sigaction.c)

15 years agosmaller brk() for i386. Inspected assembly to see it's still valid.
Denis Vlasenko [Fri, 12 Dec 2008 14:23:17 +0000 (14:23 -0000)]
smaller brk() for i386. Inspected assembly to see it's still valid.
    text           data     bss     dec     hex filename
-     44              0       4      48      30 libc/sysdeps/linux/i386/brk.o
+     42              0       4      46      2e libc/sysdeps/linux/i386/brk.o

15 years agoMove kernel-features.h header from the linuxthread directory
Carmelo Amoroso [Thu, 11 Dec 2008 14:45:14 +0000 (14:45 -0000)]
Move kernel-features.h header from the linuxthread directory
to a common one (libc/sysdeps/linux/common/bits) so that any
function can access to supported kernel feature (i.e. getdents).

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
15 years agocreate arch-generic brk() based on blackfin one
Mike Frysinger [Thu, 11 Dec 2008 10:08:00 +0000 (10:08 -0000)]
create arch-generic brk() based on blackfin one

15 years agoadd inlines for Blackfin atomic functions
Mike Frysinger [Thu, 11 Dec 2008 10:04:41 +0000 (10:04 -0000)]
add inlines for Blackfin atomic functions

15 years agoBlackfin: add L2_SRAM flag for alloc func
Mike Frysinger [Thu, 11 Dec 2008 10:03:47 +0000 (10:03 -0000)]
Blackfin: add L2_SRAM flag for alloc func

15 years agoBlackfin: declare {INLINE,INTERNAL}_SYSCALL() and friends
Mike Frysinger [Thu, 11 Dec 2008 10:02:54 +0000 (10:02 -0000)]
Blackfin: declare {INLINE,INTERNAL}_SYSCALL() and friends

15 years agoadd ENDPROC() macro for Blackfin assembly
Mike Frysinger [Thu, 11 Dec 2008 10:02:20 +0000 (10:02 -0000)]
add ENDPROC() macro for Blackfin assembly

15 years agouse newer spiffy asm constraints to get better code generation
Mike Frysinger [Thu, 11 Dec 2008 10:01:31 +0000 (10:01 -0000)]
use newer spiffy asm constraints to get better code generation

15 years agopunt old unused header
Mike Frysinger [Thu, 11 Dec 2008 09:58:24 +0000 (09:58 -0000)]
punt old unused header

15 years agoupdate ptrace.h to latest from glibc
Mike Frysinger [Thu, 11 Dec 2008 09:50:47 +0000 (09:50 -0000)]
update ptrace.h to latest from glibc

15 years agoget rid of __libc_* symbols. Some whitespace cleanups.
Khem Raj [Thu, 11 Dec 2008 00:41:38 +0000 (00:41 -0000)]
get rid of __libc_* symbols. Some whitespace cleanups.

15 years ago*: remove some __libc_XXX functions:
Denis Vlasenko [Wed, 10 Dec 2008 22:41:30 +0000 (22:41 -0000)]
*: remove some __libc_XXX functions:
__libc_accept __libc_close __libc_connect __libc_creat __libc_creat64
__libc_fsync __libc_lseek __libc_lseek64 __libc_msync __libc_nanosleep
__libc_open __libc_open64 __libc_pause __libc_read __libc_readv
__libc_recv __libc_recvfrom __libc_recvmsg
__libc_send __libc_sendmsg __libc_sendto
__libc_tcdrain __libc_wait __libc_waitpid __libc_write __libc_writev
They were removed from glibc 1 May 2004:
http://sources.redhat.com/ml/libc-hacker/2004-05/msg00001.html

15 years agoremove __libc_fcntl[64]
Denis Vlasenko [Wed, 10 Dec 2008 17:33:45 +0000 (17:33 -0000)]
remove __libc_fcntl[64]

15 years agoremove __libc_getdomainname alias. google says only we have it.
Denis Vlasenko [Wed, 10 Dec 2008 16:40:40 +0000 (16:40 -0000)]
remove __libc_getdomainname alias. google says only we have it.

15 years ago- document environment variables used by the install_* targets.
Bernhard Reutner-Fischer [Wed, 10 Dec 2008 09:09:07 +0000 (09:09 -0000)]
- document environment variables used by the install_* targets.
  See their config helptexts for further detail.

15 years agoRemove hardwired usr/ from install_utils (that's what $RUNTIME_PREFIX is for)
Rob Landley [Wed, 10 Dec 2008 00:29:29 +0000 (00:29 -0000)]
Remove hardwired usr/ from install_utils (that's what $RUNTIME_PREFIX is for)
and add install_hostutils.  Now install_utils should use $PREFIX more like
other packages do.

15 years agosmaller memcpy
Denis Vlasenko [Tue, 9 Dec 2008 13:23:59 +0000 (13:23 -0000)]
smaller memcpy

    text           data     bss     dec     hex filename
-     39              0       0      39      27 libc/string/i386/memcpy.os
+     35              0       0      35      23 libc/string/i386/memcpy.os

15 years agosetenv.c: tiny code shrink
Denis Vlasenko [Tue, 9 Dec 2008 10:23:43 +0000 (10:23 -0000)]
setenv.c: tiny code shrink

    text           data     bss     dec     hex filename
-    546              0       4     550     226 libc/stdlib/setenv.o
+    538              0       4     542     21e libc/stdlib/setenv.o

15 years agosetenv.c: further code shrink
Denis Vlasenko [Tue, 9 Dec 2008 10:04:47 +0000 (10:04 -0000)]
setenv.c: further code shrink

    text           data     bss     dec     hex filename
-    672              0       4     676     2a4 libc/stdlib/setenv.o
+    546              0       4     550     226 libc/stdlib/setenv.o

15 years ago- improve documentation of utils and hostutils
Bernhard Reutner-Fischer [Tue, 9 Dec 2008 09:11:02 +0000 (09:11 -0000)]
- improve documentation of utils and hostutils

15 years agoMention make utils, hostutils, install_utils.
Rob Landley [Tue, 9 Dec 2008 08:02:02 +0000 (08:02 -0000)]
Mention make utils, hostutils, install_utils.

15 years agofix segv on clearenv(); unsetenv("foo"); [was deref'ing NULL],
Denis Vlasenko [Tue, 9 Dec 2008 02:20:54 +0000 (02:20 -0000)]
fix segv on clearenv(); unsetenv("foo"); [was deref'ing NULL],
add a few missing ENOMEMs, some code shrinking

    text           data     bss     dec     hex filename
-    727              0       4     731     2db libc/stdlib/setenv.o
+    672              0       4     676     2a4 libc/stdlib/setenv.o

15 years agogetaddrinfo: runp->ifa_addr indeed can be NULL, don't dereference it
Denis Vlasenko [Tue, 9 Dec 2008 00:16:11 +0000 (00:16 -0000)]
getaddrinfo: runp->ifa_addr indeed can be NULL, don't dereference it
ifaddrs.c: cosmetics, no code changes

15 years agogetaddrinfo: remove superfluout indentation, fix incorrect one.
Denis Vlasenko [Mon, 8 Dec 2008 23:53:21 +0000 (23:53 -0000)]
getaddrinfo: remove superfluout indentation, fix incorrect one.
 remove one superfluous statement.

15 years ago- fix loop for checking ifaddr on both IPv4 and IPv6
Bernhard Reutner-Fischer [Mon, 8 Dec 2008 13:12:42 +0000 (13:12 -0000)]
- fix loop for checking ifaddr on both IPv4 and IPv6

15 years agoresolver: make new name resolutions reread /etc/resolv.conf
Denis Vlasenko [Sat, 6 Dec 2008 20:12:15 +0000 (20:12 -0000)]
resolver: make new name resolutions reread /etc/resolv.conf
 if 256+ seconds passed since last read;
 fix cases where we switch to next search domain instead of switching
 to new server
 optimize ip4/ip6 combined cases;
 rewrite for(;;) loops so that it's clearer what's going on;
 document buffer usage;
 add TODOs and FIXMEs (for one, gethostbyname2 does not fill
 ->h_aliases field in the result AT ALL, and is iffy in general)

    text    data     bss     dec     hex filename
- 245898    1403   11904  259205   3f485 libuClibc-0.9.30-svn.so
+ 245785    1403   11904  259092   3f414 libuClibc-0.9.30-svn.so

15 years agoRemove __NTH from the declation.
Khem Raj [Thu, 4 Dec 2008 19:57:38 +0000 (19:57 -0000)]
Remove __NTH from the declation.

15 years agoCLean librt/*.oS too (NPTL will add some).
Carmelo Amoroso [Thu, 4 Dec 2008 15:49:26 +0000 (15:49 -0000)]
CLean librt/*.oS too (NPTL will add some).

15 years agoGo deeper while cleaning string directory to remove
Carmelo Amoroso [Thu, 4 Dec 2008 14:30:50 +0000 (14:30 -0000)]
Go deeper while cleaning string directory to remove
TARGET_SUBARCH implementation too.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
15 years agoAdded do_awk commanf for invoking awk parser. It will be used
Carmelo Amoroso [Thu, 4 Dec 2008 08:50:56 +0000 (08:50 -0000)]
Added do_awk commanf for invoking awk parser. It will be used
for generating some file on-the-fly on the NPTL case.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
15 years ago- use proper macros
Bernhard Reutner-Fischer [Wed, 3 Dec 2008 19:43:01 +0000 (19:43 -0000)]
- use proper macros

15 years ago- use proper macro (no obj-code changes)
Bernhard Reutner-Fischer [Wed, 3 Dec 2008 19:41:55 +0000 (19:41 -0000)]
- use proper macro (no obj-code changes)

15 years ago- Use runtime pagesize (Jeremy Kerr)
Bernhard Reutner-Fischer [Wed, 3 Dec 2008 19:40:55 +0000 (19:40 -0000)]
- Use runtime pagesize (Jeremy Kerr)
Some powerpc machines can support 64k pages, enabled by the
CONFIG_64K_PAGES option in linux.

However, the uClibc dynamic loader won't currently work on these
machines, as it uses hard-coded values (PAGE_ALIGN, ADDR_ALIGN and
OFFS_ALIGN) in the ldso architecture-specific headers.  When running on
a kernel with 64k pages, ld.so tries to mmap with 4k-aligned addresses,
rather than 64k, so mmap fails with -EINVAL.

When booting a 64k machine with a uClibc dynamic linker, init fails
with:

/init:500: can't map '/lib/libc.so.0'
/init:500: can't map '/lib/libc.so.0'
/init:500: can't map '/lib/libc.so.0'
/init: can't load library 'libc.so.0'
Kernel panic - not syncing: Attempted to kill init!

This change allows ld.so determine these alignment masks at runtime,
rather than compile-time. Since we have the _dl_pagesize variable
available, we can use that to generate the appropriate masks.

Since almost all of the architectures can use the common definitions for
the _ALIGN macros, we can consolidate them all in ldso.h, and override
in the sysdep headers where necessary (ie, mips).

This allows me to start a uClibc-based root fs on a 64k machine.

Signed-off-by: Jeremy Kerr <jk at ozlabs org>
15 years agoA missing change when we recently released a lot of fix
Carmelo Amoroso [Wed, 3 Dec 2008 14:07:45 +0000 (14:07 -0000)]
A missing change when we recently released a lot of fix
on localae support

15 years agoTwo other absolutely safe change that will be used by NPTL, aimed
Carmelo Amoroso [Wed, 3 Dec 2008 14:06:15 +0000 (14:06 -0000)]
Two other absolutely safe change that will be used by NPTL, aimed
to simplify merge.

15 years agoFix wcswidth function when LOCALE support is disabled
Carmelo Amoroso [Tue, 2 Dec 2008 17:14:47 +0000 (17:14 -0000)]
Fix wcswidth function when LOCALE support is disabled
while keeping WCHAR support enabled. This solves two
testcases: tst_wcwidth and tst_wcswidth.

Fix dat_iswctype.c fiinput file: character 0x80 is not
a control character: it fixes tst_iswctype test.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
15 years agohostid: improve extremely unreadable parts
Denis Vlasenko [Mon, 1 Dec 2008 21:16:46 +0000 (21:16 -0000)]
hostid: improve extremely unreadable parts
*: remove checks of sigaction and sigprocmask results
 in cases where they clearly can't fail:
 sigaction(known_good_sig)
 sigprocmask(known_good_how)

    text           data     bss     dec     hex filename
-    393              4       0     397     18d libc/pwd_grp/lckpwdf.o
+    382              4       0     386     182 libc/pwd_grp/lckpwdf.o
-     56              0       0      56      38 libc/signal/sigblock.o
+     44              0       0      44      2c libc/signal/sigblock.o
-    211              0       0     211      d3 libc/signal/sigset.o
+    202              0       0     202      ca libc/signal/sigset.o
-     56              0       0      56      38 libc/signal/sigsetmask.o
+     44              0       0      44      2c libc/signal/sigsetmask.o
-    309              0       0     309     135 libc/unistd/sleep.o
+    256              0       0     256     100 libc/unistd/sleep.o

15 years agoon Bernd's request, remove commented-out code snippets
Denis Vlasenko [Mon, 1 Dec 2008 20:29:52 +0000 (20:29 -0000)]
on Bernd's request, remove commented-out code snippets

15 years agoremove checks for "impossible" errors,
Denis Vlasenko [Mon, 1 Dec 2008 18:41:55 +0000 (18:41 -0000)]
remove checks for "impossible" errors,
clarify uses of unoptimized sigXXX ops (they check signo),
use faster sigops where approproate.

    text           data     bss     dec     hex filename
-     68              0       0      68      44 libc/signal/sighold.o
+     63              0       0      63      3f libc/signal/sighold.o
-    114              0       0     114      72 libc/signal/sigintr.o
+    110              0       0     110      6e libc/signal/sigintr.o
-    113              0       0     113      71 libc/signal/sigpause.o
+    108              0       0     108      6c libc/signal/sigpause.o
-     68              0       0      68      44 libc/signal/sigrelse.o
+     63              0       0      63      3f libc/signal/sigrelse.o

15 years agofix sigset_t size for mips (it's the only arch with 128 signals).
Denis Vlasenko [Mon, 1 Dec 2008 18:00:04 +0000 (18:00 -0000)]
fix sigset_t size for mips (it's the only arch with 128 signals).
fix _NSIG for it.
better document what's going on in sigaction().
seems to not induce any actual code changes (sans mips).

15 years agooptimize signal mask ops. comment out "impossible" errors
Denis Vlasenko [Mon, 1 Dec 2008 15:31:22 +0000 (15:31 -0000)]
optimize signal mask ops. comment out "impossible" errors

    text           data     bss     dec     hex filename
-   1179             13       2    1194     4aa libc/misc/syslog/syslog.o
+   1165             13       2    1180     49c libc/misc/syslog/syslog.o
-    435              4       0     439     1b7 libc/pwd_grp/lckpwdf.o
+    393              4       0     397     18d libc/pwd_grp/lckpwdf.o
-     38              0       0      38      26 libc/signal/sigandset.o
+     32              0       0      32      20 libc/signal/sigandset.o
-     63              0       0      63      3f libc/signal/sigblock.o
+     56              0       0      56      38 libc/signal/sigblock.o
-     22              0       0      22      16 libc/signal/sigempty.o
+     20              0       0      20      14 libc/signal/sigempty.o
-     25              0       0      25      19 libc/signal/sigfillset.o
+     20              0       0      20      14 libc/signal/sigfillset.o
-     34              0       0      34      22 libc/signal/sigisempty.o
+     16              0       0      16      10 libc/signal/sigisempty.o
-     38              0       0      38      26 libc/signal/sigorset.o
+     32              0       0      32      20 libc/signal/sigorset.o
-    119              0       0     119      77 libc/signal/sigpause.o
+    113              0       0     113      71 libc/signal/sigpause.o
-    215              0       0     215      d7 libc/signal/sigset.o
+    211              0       0     211      d3 libc/signal/sigset.o
-     63              0       0      63      3f libc/signal/sigsetmask.o
+     56              0       0      56      38 libc/signal/sigsetmask.o
-    194              0       1     195      c3 libc/stdlib/abort.o
+    183              0       1     184      b8 libc/stdlib/abort.o
-    323              0       0     323     143 libc/unistd/sleep.o
+    309              0       0     309     135 libc/unistd/sleep.o

15 years agol64a: shrink by 13 bytes, and -1 reloc
Denis Vlasenko [Mon, 1 Dec 2008 11:03:35 +0000 (11:03 -0000)]
l64a: shrink by 13 bytes, and -1 reloc

15 years agoconstify more data
Denis Vlasenko [Mon, 1 Dec 2008 10:33:19 +0000 (10:33 -0000)]
constify more data

 text+data text+rodata    rwdata       bss filename
-     2534        2510        24         0 libc/inet/rpc/clnt_udp.o
+     2534        2534         0         0 libc/inet/rpc/clnt_udp.o
-     1904        1880        24         0 libc/inet/rpc/clnt_tcp.o
+     1904        1904         0         0 libc/inet/rpc/clnt_tcp.o
-      770         746        24         4 libc/inet/rpc/clnt_raw.o
+      770         770         0         4 libc/inet/rpc/clnt_raw.o

15 years agorpc: constify data, localize unnecessarily static data
Denis Vlasenko [Mon, 1 Dec 2008 10:02:44 +0000 (10:02 -0000)]
rpc: constify data, localize unnecessarily static data

 text+data text+rodata    rwdata       bss filename
-     2308        2284        24        24 libc/inet/rpc/clnt_unix.o
+     2308        2308         0         0 libc/inet/rpc/clnt_unix.o

15 years agorandom: use smaller data fields where appropriate
Denis Vlasenko [Mon, 1 Dec 2008 09:43:37 +0000 (09:43 -0000)]
random: use smaller data fields where appropriate

    text           data     bss     dec     hex filename
-    130            156       0     286     11e libc/stdlib/random.o
+    130            148       0     278     116 libc/stdlib/random.o
-    586              0       0     586     24a libc/stdlib/random_r.o
+    570              0       0     570     23a libc/stdlib/random_r.o

15 years agogethostbyname can use gethostbyname2, saving one nearly 0.5k static buffer
Denis Vlasenko [Mon, 1 Dec 2008 09:41:41 +0000 (09:41 -0000)]
gethostbyname can use gethostbyname2, saving one nearly 0.5k static buffer

    text           data     bss     dec     hex filename
-     45              0     480     525     20d libc/inet/gethostbyname.o
+     18              0       0      18      12 libc/inet/gethostbyname.o

15 years agorpc: should check against max for int32, not int
Denis Vlasenko [Mon, 1 Dec 2008 08:40:30 +0000 (08:40 -0000)]
rpc: should check against max for int32, not int

15 years agorpc: ifdef out xdrrec_{get,put}long if int32 == long,
Denis Vlasenko [Mon, 1 Dec 2008 08:37:27 +0000 (08:37 -0000)]
rpc: ifdef out xdrrec_{get,put}long if int32 == long,
 otherwise use xdrrec_{get,put}int32 + trivial transform.
 eliminate warnings.
des: small shrink + eliminate a warning

15 years agoadd libc_hidden_proto(__cmsg_nxthdr) for mips
Denis Vlasenko [Sat, 29 Nov 2008 21:45:14 +0000 (21:45 -0000)]
add libc_hidden_proto(__cmsg_nxthdr) for mips

15 years agofix improperly hidden fputc_unlocked
Denis Vlasenko [Sat, 29 Nov 2008 21:24:21 +0000 (21:24 -0000)]
fix improperly hidden fputc_unlocked

15 years agofix improperly hidden fwprintf.
Denis Vlasenko [Sat, 29 Nov 2008 20:45:56 +0000 (20:45 -0000)]
fix improperly hidden fwprintf.
make two data objects static.

    text           data     bss     dec     hex filename
- 274779           1835   19012  295626   482ca lib/libuClibc-0.9.30-svn.so
+ 274693           1835   19012  295540   48274 lib/libuClibc-0.9.30-svn.so

15 years agoshring sugnal-relared stuff a bit. BTW why constant memset is not inlined by gcc?
Denis Vlasenko [Sat, 29 Nov 2008 16:46:07 +0000 (16:46 -0000)]
shring sugnal-relared stuff a bit. BTW why constant memset is not inlined by gcc?

    text           data     bss     dec     hex filename
-  38015          18096    8636   64747    fceb lib/libpthread-0.9.30-svn.so
+  38001          18096    8636   64733    fcdd lib/libpthread-0.9.30-svn.so
- 274842           1835   19012  295689   48309 lib/libuClibc-0.9.30-svn.so
+ 274779           1835   19012  295626   482ca lib/libuClibc-0.9.30-svn.so

15 years agoreduce sigset_t size for 128 bytes to 64 bits:
Denis Vlasenko [Sat, 29 Nov 2008 15:35:51 +0000 (15:35 -0000)]
reduce sigset_t size for 128 bytes to 64 bits:

    text           data     bss     dec     hex filename
-  38457          18352    8636   65445    ffa5 lib/libpthread-0.9.30-svn.so
+  38015          18096    8636   64747    fceb lib/libpthread-0.9.30-svn.so
-   8205            280      12    8497    2131 lib/libthread_db-0.9.30-svn.so
+   8193            280      12    8485    2125 lib/libthread_db-0.9.30-svn.so
- 275208           1823   19132  296163   484e3 lib/libuClibc-0.9.30-svn.so
+ 274787           1823   19012  295622   482c6 lib/libuClibc-0.9.30-svn.so

15 years agoMake __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__ visible in case the arch
Carmelo Amoroso [Thu, 27 Nov 2008 14:52:15 +0000 (14:52 -0000)]
Make __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__ visible in case the arch
supports this feature. SH4 will use this in some aseembly files
for the NPTL implementation. Add now safely on trunk.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
15 years ago- make isascii visible again
Bernhard Reutner-Fischer [Thu, 27 Nov 2008 14:17:13 +0000 (14:17 -0000)]
- make isascii visible again
  TODO: *_l() should go

15 years agoThis patch fixes locale-mbwc test failures when __UCLIBC_HAS_LOCALE__ is
Carmelo Amoroso [Wed, 26 Nov 2008 15:12:16 +0000 (15:12 -0000)]
This patch fixes locale-mbwc test failures when __UCLIBC_HAS_LOCALE__ is
disabled and __UCLIBC_HAS_WCHAR__ is enabled. The only locale available
when __UCLIBC_HAS_LOCALE__ is disabled is the C locale, the others locale
are skipped.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
15 years ago- remove fstatfs() and statfs() related headers upon request
Bernhard Reutner-Fischer [Wed, 26 Nov 2008 09:24:33 +0000 (09:24 -0000)]
- remove fstatfs() and statfs() related headers upon request

15 years ago- revert 24148:24151
Bernhard Reutner-Fischer [Wed, 26 Nov 2008 08:41:09 +0000 (08:41 -0000)]
- revert 24148:24151

15 years agolibc/string: need additional work to remove libc_hidden_proto's properly
Denis Vlasenko [Wed, 26 Nov 2008 01:21:10 +0000 (01:21 -0000)]
libc/string: need additional work to remove libc_hidden_proto's properly