[PATCH] D125873: [asan] Add the FreeBSD AArch64 shadow offset to llvm
Ed Maste via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 06:59:07 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe13bd2644edf: Add the FreeBSD AArch64 shadow offset to llvm (authored by andrew, committed by emaste).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125873/new/
https://reviews.llvm.org/D125873
Files:
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/Instrumentation/AddressSanitizer/freebsd.ll
Index: llvm/test/Instrumentation/AddressSanitizer/freebsd.ll
===================================================================
--- llvm/test/Instrumentation/AddressSanitizer/freebsd.ll
+++ llvm/test/Instrumentation/AddressSanitizer/freebsd.ll
@@ -8,6 +8,11 @@
; RUN: -data-layout="e-m:e-i64:64-f80:128-n8:16:32:64-S128" | \
; RUN: FileCheck --check-prefix=CHECK-64 %s
+; RUN: opt < %s -passes='asan-pipeline' -S \
+; RUN: -mtriple=aarch64-unknown-freebsd \
+; RUN: -data-layout="e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" | \
+; RUN: FileCheck --check-prefix=CHECK-AARCH64 %s
+
; RUN: opt < %s -passes='asan-pipeline' -S \
; RUN: -mtriple=mips64-unknown-freebsd \
; RUN: -data-layout="E-m:e-i64:64-n32:64-S128" | \
@@ -33,6 +38,13 @@
; CHECK-64-NEXT: {{70368744177664}}
; CHECK-64: ret
+; CHECK-AARCH64: @read_4_bytes
+; CHECK-AARCH64-NOT: ret
+; Check for ASAN's Offset for 64-bit (2^47 or 0x800000000000)
+; CHECK-AARCH64: lshr {{.*}} 3
+; CHECK-AARCH64-NEXT: {{140737488355328}}
+; CHECK-AARCH64: ret
+
; CHECK-MIPS64: @read_4_bytes
; CHECK-MIPS64-NOT: ret
; Check for ASAN's Offset for 64-bit (2^37 or 0x2000000000)
Index: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -108,6 +108,7 @@
static const uint64_t kRISCV64_ShadowOffset64 = 0xd55550000;
static const uint64_t kFreeBSD_ShadowOffset32 = 1ULL << 30;
static const uint64_t kFreeBSD_ShadowOffset64 = 1ULL << 46;
+static const uint64_t kFreeBSDAArch64_ShadowOffset64 = 1ULL << 47;
static const uint64_t kFreeBSDKasan_ShadowOffset64 = 0xdffff7c000000000;
static const uint64_t kNetBSD_ShadowOffset32 = 1ULL << 30;
static const uint64_t kNetBSD_ShadowOffset64 = 1ULL << 46;
@@ -523,6 +524,8 @@
Mapping.Offset = kPPC64_ShadowOffset64;
else if (IsSystemZ)
Mapping.Offset = kSystemZ_ShadowOffset64;
+ else if (IsFreeBSD && IsAArch64)
+ Mapping.Offset = kFreeBSDAArch64_ShadowOffset64;
else if (IsFreeBSD && !IsMIPS64) {
if (IsKasan)
Mapping.Offset = kFreeBSDKasan_ShadowOffset64;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125873.445805.patch
Type: text/x-patch
Size: 2247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220719/5abb95e0/attachment.bin>
More information about the llvm-commits
mailing list