1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

Update the comments for the macho-invalid-zero-ncmds test and fix

llvm-objdump when printing the Mach Header to print the unknown
cputype and cpusubtype fields as decimal instead of not printing
them at all.  And change the test to check for that.

llvm-svn: 258826
This commit is contained in:
Kevin Enderby 2016-01-26 18:20:49 +00:00
parent 3823f0b2bd
commit bfbad8d3aa
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,9 @@
// No crash, might not be totally invalid
RUN: llvm-objdump -private-headers %p/Inputs/macho-invalid-zero-ncmds
// An odd Mach-O file, with just a mach header with all but the magic field
// and filetype zeros. The cputype and cpusubtype fields being zero are invalid,
// but that does not mater for the most part to display some of the contents.
RUN: llvm-objdump -private-headers %p/Inputs/macho-invalid-zero-ncmds -macho \
RUN: | FileCheck -check-prefix ZERO-NCMDS %s
ZERO-NCMDS: MH_MAGIC_64 0 0 0x00 OBJECT 0 0 0x00000000
RUN: not llvm-objdump -private-headers %p/Inputs/macho64-invalid-incomplete-load-command 2>&1 \
RUN: | FileCheck -check-prefix INCOMPLETE-LOADC %s

View File

@ -6893,6 +6893,10 @@ static void PrintMachHeader(uint32_t magic, uint32_t cputype,
break;
}
break;
default:
outs() << format(" %7d", cputype);
outs() << format(" %10d", cpusubtype & ~MachO::CPU_SUBTYPE_MASK);
break;
}
if ((cpusubtype & MachO::CPU_SUBTYPE_MASK) == MachO::CPU_SUBTYPE_LIB64) {
outs() << " LIB64";