summaryrefslogtreecommitdiff
path: root/linker/linker_main.cpp
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2019-01-12 00:57:12 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-01-12 00:57:12 +0000
commit2242cca714786c1eddee6fe6a9c48142128da3c1 (patch)
treefe566eac57d2354c8b6bf27fc9db698fe57ea6be /linker/linker_main.cpp
parent98564b8c743a5fdea7b8bb7c016921f208b9e1bb (diff)
parent45d1349c638426d99a5319e7be3dbb7c36ece7eb (diff)
Merge changes I65430637,Ib75d9dab
* changes: Reorganize static TLS memory for ELF TLS pthread_key.cpp: factor out get_thread_key_data
Diffstat (limited to 'linker/linker_main.cpp')
-rw-r--r--linker/linker_main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp
index 3318c2c7f..9b4ce47c3 100644
--- a/linker/linker_main.cpp
+++ b/linker/linker_main.cpp
@@ -36,6 +36,7 @@
#include "linker_gdb_support.h"
#include "linker_globals.h"
#include "linker_phdr.h"
+#include "linker_tls.h"
#include "linker_utils.h"
#include "private/bionic_globals.h"
@@ -51,6 +52,7 @@
#include <async_safe/log.h>
#include <bionic/libc_init_common.h>
+#include <bionic/pthread_internal.h>
#include <vector>
@@ -450,6 +452,10 @@ static ElfW(Addr) linker_main(KernelArgumentBlock& args, const char* exe_to_load
si->increment_ref_count();
}
+ layout_linker_static_tls();
+
+ __libc_init_main_thread_final();
+
if (!get_cfi_shadow()->InitialLinkDone(solist)) __linker_cannot_link(g_argv[0]);
si->call_pre_init_constructors();
@@ -557,7 +563,8 @@ __linker_init_post_relocation(KernelArgumentBlock& args, soinfo& linker_so);
extern "C" ElfW(Addr) __linker_init(void* raw_args) {
// Initialize TLS early so system calls and errno work.
KernelArgumentBlock args(raw_args);
- __libc_init_main_thread_early(args);
+ bionic_tcb temp_tcb = {};
+ __libc_init_main_thread_early(args, &temp_tcb);
// When the linker is run by itself (rather than as an interpreter for
// another program), AT_BASE is 0.