forked from OSchip/llvm-project
[AddressSanitizer] Put shadow at 0 for Fuchsia
The Fuchsia ASan runtime reserves the low part of the address space. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D30426 llvm-svn: 296405
This commit is contained in:
parent
fa912a7151
commit
6f16857167
|
@ -394,6 +394,7 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize,
|
||||||
TargetTriple.getArch() == llvm::Triple::mips64el;
|
TargetTriple.getArch() == llvm::Triple::mips64el;
|
||||||
bool IsAArch64 = TargetTriple.getArch() == llvm::Triple::aarch64;
|
bool IsAArch64 = TargetTriple.getArch() == llvm::Triple::aarch64;
|
||||||
bool IsWindows = TargetTriple.isOSWindows();
|
bool IsWindows = TargetTriple.isOSWindows();
|
||||||
|
bool IsFuchsia = TargetTriple.isOSFuchsia();
|
||||||
|
|
||||||
ShadowMapping Mapping;
|
ShadowMapping Mapping;
|
||||||
|
|
||||||
|
@ -414,7 +415,11 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize,
|
||||||
else
|
else
|
||||||
Mapping.Offset = kDefaultShadowOffset32;
|
Mapping.Offset = kDefaultShadowOffset32;
|
||||||
} else { // LongSize == 64
|
} else { // LongSize == 64
|
||||||
if (IsPPC64)
|
// Fuchsia is always PIE, which means that the beginning of the address
|
||||||
|
// space is always available.
|
||||||
|
if (IsFuchsia)
|
||||||
|
Mapping.Offset = 0;
|
||||||
|
else if (IsPPC64)
|
||||||
Mapping.Offset = kPPC64_ShadowOffset64;
|
Mapping.Offset = kPPC64_ShadowOffset64;
|
||||||
else if (IsSystemZ)
|
else if (IsSystemZ)
|
||||||
Mapping.Offset = kSystemZ_ShadowOffset64;
|
Mapping.Offset = kSystemZ_ShadowOffset64;
|
||||||
|
|
Loading…
Reference in New Issue