musl/src
Rich Felker 607b05aca6 use explicit visibility to optimize a few hot-path function calls
on x86 and some other archs, functions which make function calls which
might go through a PLT incur a significant overhead cost loading the
GOT register prior to making the call. this load is utterly useless in
musl, since all calls are bound at library-creation time using
-Bsymbolic-functions, but the compiler has no way of knowing this, and
attempts to set the default visibility to protected have failed due to
bugs in GCC and binutils.

this commit simply manually assigns hidden/protected visibility, as
appropriate, to a few internal-use-only functions which have many
callers, or which have callers that are hot paths like getc/putc. it
shaves about 5k off the i386 libc.so with -Os. many of the
improvements are in syscall wrappers, where the benefit is just size
and performance improvement is unmeasurable noise amid the syscall
overhead. however, stdio may be measurably faster.

if in the future there are toolchains that can do the same thing
globally without introducing linking bugs, it might be worth
considering removing these workarounds.
2012-10-25 15:40:58 -04:00
..
aio use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
complex add creal/cimag macros in complex.h (and use them in the functions defs) 2012-03-22 15:54:55 -04:00
conf let sysconf accurately report # of cpus available 2012-05-13 00:44:35 -04:00
crypt add crypt_md5 password hash 2012-09-15 23:41:07 -04:00
ctype fix argument type error on wcwidth function 2012-08-02 21:02:34 -04:00
dirent use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
env as an extension, have putenv("VAR") behave as unsetenv("VAR") 2012-10-21 18:37:15 -04:00
errno better description for errno==0 2012-04-16 18:37:53 -04:00
exit further use of _Noreturn, for non-plain-C functions 2012-09-06 23:34:10 -04:00
fcntl move fallocate syscall wrapper to linux-specific syscalls dir 2012-09-08 00:41:11 -04:00
fenv floating point environment/exceptions support for mips 2012-10-18 20:19:53 -04:00
internal use explicit visibility to optimize a few hot-path function calls 2012-10-25 15:40:58 -04:00
ipc fix remaining IPC_64 issue (shmctl) 2012-09-22 16:08:58 -04:00
ldso support looking up thread-local objects with dlsym 2012-10-19 21:57:56 -04:00
legacy more close-on-exec fixes, mostly using new "e" flag to fopen 2012-09-29 18:14:46 -04:00
linux move accept4, dup3, and pipe2 to non-linux-specific locations 2012-09-29 17:40:42 -04:00
locale use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
malloc workaround gcc got-register-reload performance problems in malloc 2012-09-14 23:52:51 -04:00
math Merge remote-tracking branch 'nsz/exp' 2012-08-13 21:55:22 -04:00
misc add getopt reset support 2012-09-30 20:00:38 -04:00
mman overhaul sem_open 2012-09-30 19:35:40 -04:00
mq use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
multibyte use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
network fix some more O_CLOEXEC/SOCK_CLOEXEC issues 2012-09-29 17:59:50 -04:00
passwd more close-on-exec fixes, mostly using new "e" flag to fopen 2012-09-29 18:14:46 -04:00
prng ditch the priority inheritance locks; use malloc's version of lock 2012-04-24 16:32:23 -04:00
process fix usage of locks with vfork 2012-10-19 15:02:37 -04:00
regex use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
sched avoid setting nondefault scheduler too 2012-05-03 23:19:29 -04:00
search search: add comments to tsearch_avl.c 2012-05-13 01:50:53 +02:00
select use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
setjmp microblaze port 2012-09-29 01:05:31 -04:00
signal fix (hopefully; untested) completely broken/incomplete microblaze sigsetjmp 2012-10-18 00:09:36 -04:00
stat use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
stdio correct locking in stdio functions that tried to be lock-free 2012-10-24 23:16:41 -04:00
stdlib use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
string simplify logic in stpcpy; avoid copying first aligned byte twice 2012-10-22 15:17:09 -04:00
temp remove ugly prng from mk*temp and just re-poll time on retry 2011-07-28 22:03:54 -04:00
termios legacy junk compatibility grab-bag 2012-04-18 12:22:24 -04:00
thread fix order of syscall args for microblaze clone syscall 2012-10-19 00:27:03 -04:00
time more close-on-exec fixes, mostly using new "e" flag to fopen 2012-09-29 18:14:46 -04:00
unistd greatly improve freopen behavior 2012-10-24 21:16:06 -04:00