Index: lib/Transforms/Instrumentation/DataFlowSanitizer.cpp =================================================================== --- lib/Transforms/Instrumentation/DataFlowSanitizer.cpp +++ lib/Transforms/Instrumentation/DataFlowSanitizer.cpp @@ -41,6 +41,22 @@ /// address into the shadow memory range. See the function /// DataFlowSanitizer::getShadowAddress below. /// +/// On Linux/MIPS64 and Linux/AArch64, memory is laid out as follows: +/// +/// +--------------------+ 0x10000000000 (top of memory) +/// | application memory | +/// +--------------------+ 0xF000008000 (kAppAddr) +/// | | +/// | unused | +/// | | +/// +--------------------+ 0x2200000000 (kUnusedAddr) +/// | union table | +/// +--------------------+ 0x2000000000 (kUnionTableAddr) +/// | shadow memory | +/// +--------------------+ 0x0000010000 (kShadowAddr) +/// | reserved by kernel | +/// +--------------------+ 0x0000000000 +/// /// For more information, please refer to the design document: /// http://clang.llvm.org/docs/DataFlowSanitizerDesign.html @@ -420,6 +436,7 @@ bool IsX86_64 = TargetTriple.getArch() == llvm::Triple::x86_64; bool IsMIPS64 = TargetTriple.getArch() == llvm::Triple::mips64 || TargetTriple.getArch() == llvm::Triple::mips64el; + bool IsAArch64 = TargetTriple.getArch() == llvm::Triple::aarch64; const DataLayout &DL = M.getDataLayout(); @@ -432,7 +449,7 @@ ShadowPtrMul = ConstantInt::getSigned(IntptrTy, ShadowWidth / 8); if (IsX86_64) ShadowPtrMask = ConstantInt::getSigned(IntptrTy, ~0x700000000000LL); - else if (IsMIPS64) + else if (IsMIPS64 || IsAArch64) ShadowPtrMask = ConstantInt::getSigned(IntptrTy, ~0xF000000000LL); else report_fatal_error("unsupported triple");