diff options
| author | Petr Hosek <phosek@chromium.org> | 2017-02-27 22:49:37 +0000 |
|---|---|---|
| committer | Petr Hosek <phosek@chromium.org> | 2017-02-27 22:49:37 +0000 |
| commit | 6f168571675819d153663c7258504deaa50f85f7 (patch) | |
| tree | 253a6200d80fdf715cce295530d989a38fdf8bbc /llvm/lib/Transforms | |
| parent | fa912a7151aa59d71bb03cf1a60fd8dff650c482 (diff) | |
| download | bcm5719-llvm-6f168571675819d153663c7258504deaa50f85f7.tar.gz bcm5719-llvm-6f168571675819d153663c7258504deaa50f85f7.zip | |
[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
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 5b719a5bd1f..afcf86547c7 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -394,6 +394,7 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize, TargetTriple.getArch() == llvm::Triple::mips64el; bool IsAArch64 = TargetTriple.getArch() == llvm::Triple::aarch64; bool IsWindows = TargetTriple.isOSWindows(); + bool IsFuchsia = TargetTriple.isOSFuchsia(); ShadowMapping Mapping; @@ -414,7 +415,11 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize, else Mapping.Offset = kDefaultShadowOffset32; } 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; else if (IsSystemZ) Mapping.Offset = kSystemZ_ShadowOffset64; |

