diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-04-21 19:31:35 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-04-21 19:31:35 -0400 |
commit | 9b52ab1c9a44b62236089ab0272801d049bc5b1e (patch) | |
tree | e84e7d109e733abc567c18e96f0d96ddeb73ae80 /src/env/__libc_start_main.c | |
parent | 5c4f11d995cf178b3146cde0734d6988c145f243 (diff) | |
download | musl-9b52ab1c9a44b62236089ab0272801d049bc5b1e.tar.gz musl-9b52ab1c9a44b62236089ab0272801d049bc5b1e.tar.bz2 musl-9b52ab1c9a44b62236089ab0272801d049bc5b1e.tar.xz musl-9b52ab1c9a44b62236089ab0272801d049bc5b1e.zip |
micro-optimize some startup code for size
moving the call to __init_ssp from __init_security to __init_libc
makes __init_security a leaf function, which allows the compiler to
make it smaller. __init_libc is already non-leaf, and the additional
call makes no difference to the amount of register spillage.
in addition, it really made no sense for the call to __init_ssp to be
buried inside __init_security rather than parallel with other init
functions.
Diffstat (limited to 'src/env/__libc_start_main.c')
-rw-r--r-- | src/env/__libc_start_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/env/__libc_start_main.c b/src/env/__libc_start_main.c index ac374922..539f72e5 100644 --- a/src/env/__libc_start_main.c +++ b/src/env/__libc_start_main.c @@ -11,6 +11,9 @@ extern void (*const __init_array_start)() __attribute__((weak)); extern void (*const __init_array_end)() __attribute__((weak)); #endif +static void dummy1(void *p) {} +weak_alias(dummy1, __init_ssp); + #define AUX_CNT 38 extern size_t __hwcap, __sysinfo; @@ -33,6 +36,7 @@ void __init_libc(char **envp, char *pn) } __init_tls(aux); + __init_ssp((void *)aux[AT_RANDOM]); __init_security(aux); } |