with the -macho and -universal-headers flags.
Just a follow on to r273207, I missed updating the printing of the fat magic
number when the universal file is a 64-bit universal file.
rdar://
26899493
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273324
91177308-0d34-0410-b5e6-
96231b3b80d8
RUN: | FileCheck %s -check-prefix FAT
RUN: llvm-objdump %p/Inputs/macho-universal.x86_64.i386 -universal-headers -m \
RUN: -non-verbose | FileCheck %s -check-prefix NON-VERBOSE
+RUN: llvm-objdump %p/Inputs/macho-universal64.x86_64.i386 -universal-headers \
+RUN: -m | FileCheck %s -check-prefix FAT-64
UEXE-all: macho-universal.x86_64.i386 (architecture x86_64):
UEXE-all: (__TEXT,__text) section
NON-VERBOSE: offset 12288
NON-VERBOSE: size 4336
NON-VERBOSE: align 2^12 (4096)
+
+FAT-64: Fat headers
+FAT-64: fat_magic FAT_MAGIC_64
+FAT-64: nfat_arch 2
static void printMachOUniversalHeaders(const object::MachOUniversalBinary *UB,
bool verbose) {
outs() << "Fat headers\n";
- if (verbose)
- outs() << "fat_magic FAT_MAGIC\n";
- else
+ if (verbose) {
+ if (UB->getMagic() == MachO::FAT_MAGIC)
+ outs() << "fat_magic FAT_MAGIC\n";
+ else // UB->getMagic() == MachO::FAT_MAGIC_64
+ outs() << "fat_magic FAT_MAGIC_64\n";
+ } else
outs() << "fat_magic " << format("0x%" PRIx32, MachO::FAT_MAGIC) << "\n";
uint32_t nfat_arch = UB->getNumberOfObjects();