[llvm] r320219 - Register NetBSD/x86_64 in MemorySanitizer.cpp
Kamil Rytarowski via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 8 16:32:09 PST 2017
Author: kamil
Date: Fri Dec 8 16:32:09 2017
New Revision: 320219
URL: http://llvm.org/viewvc/llvm-project?rev=320219&view=rev
Log:
Register NetBSD/x86_64 in MemorySanitizer.cpp
Summary:
Reuse the Linux new mapping as it is.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, eugenis, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D41022
Modified:
llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp?rev=320219&r1=320218&r2=320219&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Fri Dec 8 16:32:09 2017
@@ -320,6 +320,14 @@ static const MemoryMapParams FreeBSD_X86
0x380000000000, // OriginBase
};
+// x86_64 NetBSD
+static const MemoryMapParams NetBSD_X86_64_MemoryMapParams = {
+ 0, // AndMask
+ 0x500000000000, // XorMask
+ 0, // ShadowBase
+ 0x100000000000, // OriginBase
+};
+
static const PlatformMemoryMapParams Linux_X86_MemoryMapParams = {
&Linux_I386_MemoryMapParams,
&Linux_X86_64_MemoryMapParams,
@@ -345,6 +353,11 @@ static const PlatformMemoryMapParams Fre
&FreeBSD_X86_64_MemoryMapParams,
};
+static const PlatformMemoryMapParams NetBSD_X86_MemoryMapParams = {
+ nullptr,
+ &NetBSD_X86_64_MemoryMapParams,
+};
+
namespace {
/// \brief An instrumentation pass implementing detection of uninitialized
@@ -575,6 +588,15 @@ bool MemorySanitizer::doInitialization(M
break;
default:
report_fatal_error("unsupported architecture");
+ }
+ break;
+ case Triple::NetBSD:
+ switch (TargetTriple.getArch()) {
+ case Triple::x86_64:
+ MapParams = NetBSD_X86_MemoryMapParams.bits64;
+ break;
+ default:
+ report_fatal_error("unsupported architecture");
}
break;
case Triple::Linux:
More information about the llvm-commits
mailing list