summaryrefslogtreecommitdiff
path: root/libc/misc/internals
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2008-11-18 12:48:13 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2008-11-18 12:48:13 +0000
commit827c5f1b826b916a533c082e558fc7c6fc38de6d (patch)
tree8f4c4e4626d41801ececf13b9f06488e6ae98cb9 /libc/misc/internals
parent933df87e4e9a8d7f6901dd0417b0006c5b132439 (diff)
Move _dl_iterate_phdr into libc.so.0 and libc.a (as glibc does).
Currently we have an implementation in ld.so and libdl.a. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/misc/internals')
-rw-r--r--libc/misc/internals/__uClibc_main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index f33ecf79f..9e194983f 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -72,6 +72,11 @@ uintptr_t __guard attribute_relro;
# endif
# endif
+/*
+ * Needed to initialize _dl_phdr when statically linked
+ */
+
+void internal_function _dl_aux_init (ElfW(auxv_t) *av);
#endif /* !SHARED */
/*
@@ -114,9 +119,8 @@ weak_alias (program_invocation_name, __progname_full)
#endif
/*
- * Declare the __environ global variable and create a strong alias environ.
- * Note: Apparently we must initialize __environ to ensure that the strong
- * environ symbol is also included.
+ * Declare the __environ global variable and create a weak alias environ.
+ * This must be initialized; we cannot have a weak alias into bss.
*/
char **__environ = 0;
weak_alias(__environ, environ)
@@ -310,6 +314,12 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
}
aux_dat += 2;
}
+#ifndef SHARED
+ /* Get the program headers (_dl_phdr) from the aux vector
+ It will be used into __libc_setup_tls. */
+
+ _dl_aux_init (auxvt);
+#endif
#endif
/* We need to initialize uClibc. If we are dynamically linked this