projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
overhaul posix_spawn to use CLONE_VM instead of vfork
[musl]
/
src
/
env
/
__libc_start_main.c
diff --git
a/src/env/__libc_start_main.c
b/src/env/__libc_start_main.c
index
07613a5
..
04a454e
100644
(file)
--- a/
src/env/__libc_start_main.c
+++ b/
src/env/__libc_start_main.c
@@
-3,17
+3,21
@@
void __init_tls(size_t *);
void __init_security(size_t *);
void __init_tls(size_t *);
void __init_security(size_t *);
+void __init_ldso_ctors(void);
#define AUX_CNT 38
#define AUX_CNT 38
+extern size_t __hwcap, __sysinfo;
+
void __init_libc(char **envp)
{
void __init_libc(char **envp)
{
- size_t i, *auxv, aux[AUX_CNT];
+ size_t i, *auxv, aux[AUX_CNT]
= { 0 }
;
__environ = envp;
for (i=0; envp[i]; i++);
libc.auxv = auxv = (void *)(envp+i+1);
for (i=0; auxv[i]; i+=2) if (auxv[i]<AUX_CNT) aux[auxv[i]] = auxv[i+1];
__hwcap = aux[AT_HWCAP];
__environ = envp;
for (i=0; envp[i]; i++);
libc.auxv = auxv = (void *)(envp+i+1);
for (i=0; auxv[i]; i+=2) if (auxv[i]<AUX_CNT) aux[auxv[i]] = auxv[i+1];
__hwcap = aux[AT_HWCAP];
+ __sysinfo = aux[AT_SYSINFO];
__init_tls(aux);
__init_security(aux);
__init_tls(aux);
__init_security(aux);
@@
-34,6
+38,10
@@
int __libc_start_main(
/* Execute constructors (static) linked into the application */
if (init) init(argc, argv, envp);
/* Execute constructors (static) linked into the application */
if (init) init(argc, argv, envp);
+#ifdef SHARED
+ __init_ldso_ctors();
+#endif
+
/* Pass control to to application */
exit(main(argc, argv, envp));
return 0;
/* Pass control to to application */
exit(main(argc, argv, envp));
return 0;