summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ldso/ldso/dl-startup.c14
-rw-r--r--ldso/ldso/ldso.c6
-rw-r--r--ldso/libdl/libdl.c3
3 files changed, 20 insertions, 3 deletions
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index c2686c733..e06aa343c 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -209,6 +209,20 @@ static void * __attribute_used__ _dl_start(unsigned long args)
_dl_parse_dynamic_info(dpnt, tpnt->dynamic_info, NULL, load_addr);
#endif
+ /*
+ * BIG ASSUMPTION: We assume that the dynamic loader does not
+ * have any TLS data itself. If this ever occurs
+ * more work than what is done below for the
+ * loader will have to happen.
+ */
+#if USE_TLS
+ /* This was done by _dl_memset above. */
+ /* tpnt->l_tls_modid = 0; */
+# if NO_TLS_OFFSET != 0
+ tpnt->l_tls_offset = NO_TLS_OFFSET;
+# endif
+#endif
+
SEND_STDERR_DEBUG("Done scanning DYNAMIC section\n");
#if defined(PERFORM_BOOTSTRAP_GOT)
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index aaccb0bd1..cbf947966 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -200,9 +200,9 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
unlazy = RTLD_NOW;
}
-#if defined USE_TLS && NO_TLS_OFFSET != 0
- tpnt->l_tls_offset = NO_TLS_OFFSET;
-#endif
+#if USE_TLS
+ _dl_init_static_tls = &_dl_nothread_init_static_tls;
+#endif
/* At this point we are now free to examine the user application,
* and figure out which libraries are supposed to be called. Until
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index edb7c5033..529b865af 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -81,6 +81,9 @@ size_t _dl_pagesize = PAGE_SIZE; /* Store the page size for use later
struct r_debug *_dl_debug_addr = NULL;
#define _dl_malloc malloc
#include "../ldso/dl-debug.c"
+#if USE_TLS
+#include "../ldso/dl-tls.c"
+#endif
#include "dl-progname.h"
#include "../ldso/dl-hash.c"
#define _dl_trace_loaded_objects 0