forked from OSchip/llvm-project
[PS5] Set address sanitizer shadow offset
This commit is contained in:
parent
03cc58ff2a
commit
593fa3ab30
|
@ -110,7 +110,7 @@ static const uint64_t kFreeBSDKasan_ShadowOffset64 = 0xdffff7c000000000;
|
|||
static const uint64_t kNetBSD_ShadowOffset32 = 1ULL << 30;
|
||||
static const uint64_t kNetBSD_ShadowOffset64 = 1ULL << 46;
|
||||
static const uint64_t kNetBSDKasan_ShadowOffset64 = 0xdfff900000000000;
|
||||
static const uint64_t kPS4_ShadowOffset64 = 1ULL << 40;
|
||||
static const uint64_t kPS_ShadowOffset64 = 1ULL << 40;
|
||||
static const uint64_t kWindowsShadowOffset32 = 3ULL << 28;
|
||||
static const uint64_t kEmscriptenShadowOffset = 0;
|
||||
|
||||
|
@ -469,7 +469,7 @@ static ShadowMapping getShadowMapping(const Triple &TargetTriple, int LongSize,
|
|||
bool IsMacOS = TargetTriple.isMacOSX();
|
||||
bool IsFreeBSD = TargetTriple.isOSFreeBSD();
|
||||
bool IsNetBSD = TargetTriple.isOSNetBSD();
|
||||
bool IsPS4 = TargetTriple.isPS4();
|
||||
bool IsPS = TargetTriple.isPS();
|
||||
bool IsLinux = TargetTriple.isOSLinux();
|
||||
bool IsPPC64 = TargetTriple.getArch() == Triple::ppc64 ||
|
||||
TargetTriple.getArch() == Triple::ppc64le;
|
||||
|
@ -528,8 +528,8 @@ static ShadowMapping getShadowMapping(const Triple &TargetTriple, int LongSize,
|
|||
Mapping.Offset = kNetBSDKasan_ShadowOffset64;
|
||||
else
|
||||
Mapping.Offset = kNetBSD_ShadowOffset64;
|
||||
} else if (IsPS4)
|
||||
Mapping.Offset = kPS4_ShadowOffset64;
|
||||
} else if (IsPS)
|
||||
Mapping.Offset = kPS_ShadowOffset64;
|
||||
else if (IsLinux && IsX86_64) {
|
||||
if (IsKasan)
|
||||
Mapping.Offset = kLinuxKasan_ShadowOffset64;
|
||||
|
@ -568,7 +568,7 @@ static ShadowMapping getShadowMapping(const Triple &TargetTriple, int LongSize,
|
|||
// offset is not necessary 1/8-th of the address space. On SystemZ,
|
||||
// we could OR the constant in a single instruction, but it's more
|
||||
// efficient to load it once and use indexed addressing.
|
||||
Mapping.OrShadowOffset = !IsAArch64 && !IsPPC64 && !IsSystemZ && !IsPS4 &&
|
||||
Mapping.OrShadowOffset = !IsAArch64 && !IsPPC64 && !IsSystemZ && !IsPS &&
|
||||
!IsRISCV64 &&
|
||||
!(Mapping.Offset & (Mapping.Offset - 1)) &&
|
||||
Mapping.Offset != kDynamicShadowSentinel;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
; RUN: opt < %s -passes='asan-pipeline' -S -mtriple=x86_64-scei-ps4 | FileCheck %s
|
||||
; RUN: opt < %s -passes='asan-pipeline' -S -mtriple=x86_64-sie-ps5 | FileCheck %s
|
||||
|
||||
define i32 @read_4_bytes(i32* %a) sanitize_address {
|
||||
entry:
|
||||
|
@ -8,7 +9,7 @@ entry:
|
|||
|
||||
; CHECK: @read_4_bytes
|
||||
; CHECK-NOT: ret
|
||||
; Check for ASAN's Offset on the PS4 (2^40 or 0x10000000000)
|
||||
; Check for ASAN's Offset on the PS4/PS5 (2^40 or 0x10000000000)
|
||||
; CHECK: lshr {{.*}} 3
|
||||
; CHECK-NEXT: {{1099511627776}}
|
||||
; CHECK: ret
|
||||
|
|
Loading…
Reference in New Issue