[PATCH] D125883: [msan] Add the FreeBSD AArch64 memory layout
Andrew Turner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 18 06:30:29 PDT 2022
andrew created this revision.
andrew added a reviewer: Sanitizers.
Herald added subscribers: pengfei, hiraditya, kristof.beyls, krytarowski, arichardson.
Herald added a project: All.
andrew requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Use the FreeBSD AArch64 memory layout values when building for it.
These are based on the x86_64 values, scaled to take into account the
larger address space on AArch64.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D125883
Files:
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Index: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -417,6 +417,14 @@
0x01000000000, // OriginBase
};
+// aarch64 FreeBSD
+static const MemoryMapParams FreeBSD_AArch64_MemoryMapParams = {
+ 0x1800000000000, // AndMask
+ 0x0400000000000, // XorMask
+ 0x0200000000000, // ShadowBase
+ 0x0700000000000, // OriginBase
+};
+
// i386 FreeBSD
static const MemoryMapParams FreeBSD_I386_MemoryMapParams = {
0x000180000000, // AndMask
@@ -466,6 +474,11 @@
&Linux_AArch64_MemoryMapParams,
};
+static const PlatformMemoryMapParams FreeBSD_ARM_MemoryMapParams = {
+ nullptr,
+ &FreeBSD_AArch64_MemoryMapParams,
+};
+
static const PlatformMemoryMapParams FreeBSD_X86_MemoryMapParams = {
&FreeBSD_I386_MemoryMapParams,
&FreeBSD_X86_64_MemoryMapParams,
@@ -894,6 +907,9 @@
switch (TargetTriple.getOS()) {
case Triple::FreeBSD:
switch (TargetTriple.getArch()) {
+ case Triple::aarch64:
+ MapParams = FreeBSD_ARM_MemoryMapParams.bits64;
+ break;
case Triple::x86_64:
MapParams = FreeBSD_X86_MemoryMapParams.bits64;
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125883.430356.patch
Type: text/x-patch
Size: 1332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220518/d6420b97/attachment.bin>
More information about the llvm-commits
mailing list