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/Target/AArch64/AArch64TargetObjectFile.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/Target/AArch64/AArch64TargetObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp b/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp index 4bc2c060a06..8ae72a7ddb5 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp @@ -22,6 +22,9 @@ void AArch64_ELFTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM) { TargetLoweringObjectFileELF::Initialize(Ctx, TM); InitializeELF(TM.Options.UseInitArray); + // AARCH64 ELF ABI does not define static relocation type for TLS offset + // within a module. Do not generate AT_location for TLS variables. + SupportDebugThreadLocalLocation = false; } AArch64_MachoTargetObjectFile::AArch64_MachoTargetObjectFile() |