diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-01-05 00:44:58 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-01-05 00:44:58 +0000 |
| commit | 0184c53cbdf2c024bdacfa4dfaa02e253b73c49b (patch) | |
| tree | 0259bc69bef4ddd8ac0b39a69b97b36cdddab85a /llvm/lib/Transforms/Instrumentation | |
| parent | b18dc96de18ec5ad93fa5090411bf035f7f2cb4c (diff) | |
| download | bcm5719-llvm-0184c53cbdf2c024bdacfa4dfaa02e253b73c49b.tar.gz bcm5719-llvm-0184c53cbdf2c024bdacfa4dfaa02e253b73c49b.zip | |
Revert "Revert "[hwasan] Android: Switch from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)""
This reapplies commit r348983.
llvm-svn: 350448
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp index caa383b57f9..d04c2b76288 100644 --- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp @@ -758,10 +758,12 @@ Value *HWAddressSanitizer::untagPointer(IRBuilder<> &IRB, Value *PtrLong) { Value *HWAddressSanitizer::getHwasanThreadSlotPtr(IRBuilder<> &IRB, Type *Ty) { Module *M = IRB.GetInsertBlock()->getParent()->getParent(); if (TargetTriple.isAArch64() && TargetTriple.isAndroid()) { + // Android provides a fixed TLS slot for sanitizers. See TLS_SLOT_SANITIZER + // in Bionic's libc/private/bionic_tls.h. Function *ThreadPointerFunc = Intrinsic::getDeclaration(M, Intrinsic::thread_pointer); Value *SlotPtr = IRB.CreatePointerCast( - IRB.CreateConstGEP1_32(IRB.CreateCall(ThreadPointerFunc), 0x40), + IRB.CreateConstGEP1_32(IRB.CreateCall(ThreadPointerFunc), 0x30), Ty->getPointerTo(0)); return SlotPtr; } |

