tsan: mark cur_thread_placeholder definition as initial-exec
authorDmitry Vyukov <dvyukov@google.com>
Tue, 22 Nov 2016 08:59:17 +0000 (08:59 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Tue, 22 Nov 2016 08:59:17 +0000 (08:59 +0000)
See https://sourceware.org/bugzilla/show_bug.cgi?id=20805 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78294 for context.
Previously we marked only declaration as initial-exec. But compilers treat
initial-exec attribute somewhat differently. Mark definition as well.

llvm-svn: 287629

compiler-rt/lib/tsan/rtl/tsan_rtl.cc

index b341c41..87a1c83 100644 (file)
@@ -45,6 +45,7 @@ extern "C" void __tsan_resume() {
 namespace __tsan {
 
 #if !SANITIZER_GO && !SANITIZER_MAC
+__attribute__((tls_model("initial-exec")))
 THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64);
 #endif
 static char ctx_placeholder[sizeof(Context)] ALIGNED(64);