diff options
| author | Lei Liu <lei.liu2@windriver.com> | 2018-08-01 23:46:49 +0000 |
|---|---|---|
| committer | Lei Liu <lei.liu2@windriver.com> | 2018-08-01 23:46:49 +0000 |
| commit | 8e422b8403ebde2d7a8d7ce5a1d2bb50ea5db4f4 (patch) | |
| tree | 469e7707a75cf21e66e58e02fa8571c052831fbc /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
| parent | 9ff1489d501457c9df12a188fb062129d3b70c1f (diff) | |
| download | bcm5719-llvm-8e422b8403ebde2d7a8d7ce5a1d2bb50ea5db4f4.tar.gz bcm5719-llvm-8e422b8403ebde2d7a8d7ce5a1d2bb50ea5db4f4.zip | |
[AArch64] DWARF: do not generate AT_location for thread local
AArch64 ELF ABI does not define a static relocation type for TLS offset within
a module, which makes it impossible for compiler to generate a valid
DW_AT_location content for thread local variables. Currently LLVM generates an
invalid R_AARCH64_ABS64 relocation at the DW_AT_location field for a TLS
variable. That causes trouble for linker because thread local variable does
not have an absolute address at link time. AArch64 GCC solves the problem by
not generating DW_AT_location for thread local variables. We should do the
same in LLVM.
Differential Revision: https://reviews.llvm.org/D43860
llvm-svn: 338655
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 5b472375c49..322555a2e7d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -186,6 +186,10 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE( if (!Global && (!Expr || !Expr->isConstant())) continue; + if (Global && Global->isThreadLocal() && + !Asm->getObjFileLowering().supportDebugThreadLocalLocation()) + continue; + if (!Loc) { addToAccelTable = true; Loc = new (DIEValueAllocator) DIELoc; |

