From fc50498ced7f85279b901fce302d01e558c74c7d Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 18 Jul 2018 00:21:40 +0000 Subject: CodeGen: Don't create address significance table entries for thread-local variables. The presence of these symbols in the symbol table can cause symbol type mismatch errors (or undefined symbol errors on emulated TLS targets) and they can't be ICF'd anyway. llvm-svn: 337338 --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 30c95a7138d..1b429331a35 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1533,7 +1533,8 @@ bool AsmPrinter::doFinalization(Module &M) { // Emit address-significance attributes for all globals. OutStreamer->EmitAddrsig(); for (const GlobalValue &GV : M.global_values()) - if (!GV.getName().startswith("llvm.") && !GV.hasAtLeastLocalUnnamedAddr()) + if (!GV.isThreadLocal() && !GV.getName().startswith("llvm.") && + !GV.hasAtLeastLocalUnnamedAddr()) OutStreamer->EmitAddrsigSym(getSymbol(&GV)); } -- cgit v1.2.3