summaryrefslogtreecommitdiff
path: root/llvm/lib/BinaryFormat/MachO.cpp
AgeCommit message (Collapse)Author
2024-08-20[AArch64][MachO] Add ptrauth ABI version to arm64e cpusubtype. (#104650)Ahmed Bougacha
In a mach_header, the cpusubtype is a 32-bit field, but it's split in 2 subfields: - the low 24 bits containing the cpu subtype proper, (e.g., CPU_SUBTYPE_ARM64E 2) - the high 8 bits containing a capability field used for additional feature flags. Notably, it's only the subtype subfield that participates in fat file slice discrimination: the caps are ignored. arm64e uses the caps subfield to encode a ptrauth ABI version: - 0x80 (CPU_SUBTYPE_PTRAUTH_ABI) denotes a versioned binary - 0x40 denotes a kernel-ABI binary - 0x00-0x0F holds the ptrauth ABI version This teaches the basic obj tools to decode that (or ignore it when unneeded). It also teaches the MachO writer to default to emitting versioned binaries, but with a version of 0 (and without the kernel ABI flag). Modern arm64e requires versioned binaries: a binary with 0x00 caps in cpusubtype is now rejected by the linker and everything after. We can live without the sophistication of specifying the version and kernel ABI for now. Co-authored-by: Francis Visoiu Mistrih <francisvm@apple.com>
2023-02-07[NFC][TargetParser] Remove llvm/ADT/Triple.hArchibald Elliott
I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
2023-02-07[NFC][TargetParser] Remove llvm/Support/ARMTargetParser.hArchibald Elliott
2020-12-03[Triple][MachO] Define "arm64e", an AArch64 subarch for Pointer Auth.Ahmed Bougacha
This also teaches MachO writers/readers about the MachO cpu subtype, beyond the minimal subtype reader support present at the moment. This also defines a preprocessor macro to allow users to distinguish __arm64__ from __arm64e__. arm64e defaults to an "apple-a12" CPU, which supports v8.3a, allowing pointer-authentication codegen. It also currently defaults to ios14 and macos11. Differential Revision: https://reviews.llvm.org/D87095
2020-12-03arm64: count Triple::aarch64_32 as an aarch64 target and enable leaf frame ↵Tim Northover
pointers
2020-02-24[MachO] Add cpu(sub)type tests and improve error handlingFrancis Visoiu Mistrih
Add checks for triples that don't use mach-o, and unit tests for everything.
2020-02-21[macho][NFC] Extract all CPU_(SUB_)TYPE logic to BinaryFormatFrancis Visoiu Mistrih
This moves all the logic of converting LLVM Triples to MachO::CPU_(SUB_)TYPE from the specific target (Target)AsmBackend to more convenient functions in lib/BinaryFormat. This also gets rid of the separate two X86AsmBackend classes. The previous attempt was to add it to libObject, but that adds an unnecessary dependency to libObject from all the targets. Differential Revision: https://reviews.llvm.org/D74808