[MS ABI] Add /include directives for dynamic TLS
MSVC emits /include directives in the .drective section for the __dyn_tls_init function (decorated as ___dyn_tls_init@12 for 32-bit). This fixes PR30347. llvm-svn: 281189
This commit is contained in:
parent
cd0fffb6e1
commit
cb60a4305b
|
@ -2211,6 +2211,14 @@ void MicrosoftCXXABI::EmitThreadLocalInitFuncs(
|
|||
CodeGenModule &CGM, ArrayRef<const VarDecl *> CXXThreadLocals,
|
||||
ArrayRef<llvm::Function *> CXXThreadLocalInits,
|
||||
ArrayRef<const VarDecl *> CXXThreadLocalInitVars) {
|
||||
if (CXXThreadLocalInits.empty())
|
||||
return;
|
||||
|
||||
CGM.AppendLinkerOptions(CGM.getTarget().getTriple().getArch() ==
|
||||
llvm::Triple::x86
|
||||
? "/include:___dyn_tls_init@12"
|
||||
: "/include:__dyn_tls_init");
|
||||
|
||||
// This will create a GV in the .CRT$XDU section. It will point to our
|
||||
// initialization function. The CRT will call all of these function
|
||||
// pointers at start-up time and, eventually, at thread-creation time.
|
||||
|
|
|
@ -26,3 +26,8 @@ A f() {
|
|||
(void)b;
|
||||
return c;
|
||||
}
|
||||
|
||||
// CHECK: !llvm.module.flags = !{{{.*}}}
|
||||
// CHECK: !{{[0-9]+}} = !{i32 6, !"Linker Options", ![[link_opts:[0-9]+]]}
|
||||
// CHECK: ![[link_opts]] = !{![[dyn_tls_init:[0-9]+]]}
|
||||
// CHECK: ![[dyn_tls_init]] = !{!"/include:___dyn_tls_init@12"}
|
||||
|
|
Loading…
Reference in New Issue