[5.9] [AArch64][MachO] Support ptrauth ABI version. #7055
Merged
+865
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces additional meaning to some of the high bits in the mach-o header "flags" byte of the cpusubtype field. Quoting:
// arm64 reserves bits in the high byte for subtype-specific flags.
// On arm64e, the 6 low bits represent the ptrauth ABI version.
CPU_SUBTYPE_ARM64E_PTRAUTH_MASK = 0x3f000000,
// On arm64e, the top bit tells whether the Mach-O is versioned.
CPU_SUBTYPE_ARM64E_VERSIONED_PTRAUTH_ABI_MASK = 0x80000000,
// On arm64e, the 2nd high bit tells whether the Mach-O is using kernel ABI.
CPU_SUBTYPE_ARM64E_KERNEL_PTRAUTH_ABI_MASK = 0x40000000
rdar://110506296
(cherry picked from commit 49328b6)