summaryrefslogtreecommitdiff
path: root/lib/msan
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2017-12-09 00:27:52 +0000
committerKamil Rytarowski <n54@gmx.com>2017-12-09 00:27:52 +0000
commit9032751a665831ae53e4017e0f85d8819e67773f (patch)
tree0befed19c15dc9eadfa739a14e61bb3b9c1789a8 /lib/msan
parentba895ecaa3174f0c20468867e37dbf7210026d98 (diff)
Add NetBSD/x86_64 mapping in MSan
Summary: Reuse the Linux new mapping as it is. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41023 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan')
-rw-r--r--lib/msan/msan.h2
-rw-r--r--lib/msan/msan_allocator.cc3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/msan/msan.h b/lib/msan/msan.h
index e58dfe061..cbae44412 100644
--- a/lib/msan/msan.h
+++ b/lib/msan/msan.h
@@ -203,7 +203,7 @@ const MappingDesc kMemoryLayout[] = {
#define MEM_TO_SHADOW(mem) (LINEARIZE_MEM((mem)) + 0x100000000000ULL)
#define SHADOW_TO_ORIGIN(shadow) (((uptr)(shadow)) + 0x280000000000)
-#elif SANITIZER_LINUX && SANITIZER_WORDSIZE == 64
+#elif SANITIZER_NETBSD || (SANITIZER_LINUX && SANITIZER_WORDSIZE == 64)
#ifdef MSAN_LINUX_X86_64_OLD_MAPPING
// Requries PIE binary and ASLR enabled.
diff --git a/lib/msan/msan_allocator.cc b/lib/msan/msan_allocator.cc
index 1b134e15a..0f9942324 100644
--- a/lib/msan/msan_allocator.cc
+++ b/lib/msan/msan_allocator.cc
@@ -62,7 +62,8 @@ struct MsanMapUnmapCallback {
};
typedef SizeClassAllocator32<AP32> PrimaryAllocator;
#elif defined(__x86_64__)
-#if SANITIZER_LINUX && !defined(MSAN_LINUX_X86_64_OLD_MAPPING)
+#if SANITIZER_NETBSD || \
+ (SANITIZER_LINUX && !defined(MSAN_LINUX_X86_64_OLD_MAPPING))
static const uptr kAllocatorSpace = 0x700000000000ULL;
#else
static const uptr kAllocatorSpace = 0x600000000000ULL;