Index: llvm/trunk/include/llvm/BinaryFormat/MachO.h =================================================================== --- llvm/trunk/include/llvm/BinaryFormat/MachO.h +++ llvm/trunk/include/llvm/BinaryFormat/MachO.h @@ -1477,7 +1477,10 @@ CPU_SUBTYPE_ARM_V7EM = 16 }; -enum CPUSubTypeARM64 { CPU_SUBTYPE_ARM64_ALL = 0 }; +enum CPUSubTypeARM64 { + CPU_SUBTYPE_ARM64_ALL = 0, + CPU_SUBTYPE_ARM64E = 2, +}; enum CPUSubTypeSPARC { CPU_SUBTYPE_SPARC_ALL = 0 }; Index: llvm/trunk/test/tools/llvm-objdump/AArch64/Inputs/arm64e.macho.yaml =================================================================== --- llvm/trunk/test/tools/llvm-objdump/AArch64/Inputs/arm64e.macho.yaml +++ llvm/trunk/test/tools/llvm-objdump/AArch64/Inputs/arm64e.macho.yaml @@ -0,0 +1,11 @@ +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x0100000C + cpusubtype: 0x00000002 + filetype: 0x00000001 + ncmds: 0 + sizeofcmds: 0 + flags: 0x00000000 + reserved: 0x00000000 +... Index: llvm/trunk/test/tools/llvm-objdump/AArch64/macho-arm64e.test =================================================================== --- llvm/trunk/test/tools/llvm-objdump/AArch64/macho-arm64e.test +++ llvm/trunk/test/tools/llvm-objdump/AArch64/macho-arm64e.test @@ -0,0 +1,6 @@ +// RUN: yaml2obj %p/Inputs/arm64e.macho.yaml -o %tarm64e.o +// RUN: llvm-objdump -p %tarm64e.o | FileCheck -strict-whitespace %s + +CHECK: Mach header +CHECK-NEXT: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags +CHECK-NEXT: MH_MAGIC_64 ARM64 E 0x00 OBJECT 0 0 0x00000000 Index: llvm/trunk/tools/llvm-objdump/MachODump.cpp =================================================================== --- llvm/trunk/tools/llvm-objdump/MachODump.cpp +++ llvm/trunk/tools/llvm-objdump/MachODump.cpp @@ -2009,6 +2009,10 @@ outs() << " cputype CPU_TYPE_ARM64\n"; outs() << " cpusubtype CPU_SUBTYPE_ARM64_ALL\n"; break; + case MachO::CPU_SUBTYPE_ARM64E: + outs() << " cputype CPU_TYPE_ARM64\n"; + outs() << " cpusubtype CPU_SUBTYPE_ARM64E\n"; + break; default: printUnknownCPUType(cputype, cpusubtype); break; @@ -8084,6 +8088,9 @@ case MachO::CPU_SUBTYPE_ARM64_ALL: outs() << " ALL"; break; + case MachO::CPU_SUBTYPE_ARM64E: + outs() << " E"; + break; default: outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK); break; Index: llvm/trunk/tools/llvm-readobj/MachODumper.cpp =================================================================== --- llvm/trunk/tools/llvm-readobj/MachODumper.cpp +++ llvm/trunk/tools/llvm-readobj/MachODumper.cpp @@ -162,6 +162,7 @@ static const EnumEntry MachOHeaderCpuSubtypesARM64[] = { LLVM_READOBJ_ENUM_ENT(MachO, CPU_SUBTYPE_ARM64_ALL), + LLVM_READOBJ_ENUM_ENT(MachO, CPU_SUBTYPE_ARM64E), }; static const EnumEntry MachOHeaderCpuSubtypesSPARC[] = {