Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit bfb3d23

Browse files
committed
Fix a bug in llvm-objdump for -private-headers printing the LC_CODE_SIGNATURE Mach-O load command.
rdar://25985653 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267940 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 53c317f commit bfb3d23

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed
Binary file not shown.

test/tools/llvm-objdump/X86/macho-private-headers.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
// RUN: | FileCheck %s -check-prefix=FATi386
2222
// RUN: llvm-objdump -p -non-verbose %p/Inputs/hello.obj.macho-x86_64 \
2323
// RUN: | FileCheck %s -check-prefix=NON_VERBOSE
24+
// RUN: llvm-objdump -p %p/Inputs/codesig.macho-x86_64 \
25+
// RUN: | FileCheck %s -check-prefix=CODESIG
2426

2527
CHECK: Mach header
2628
CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
@@ -537,3 +539,8 @@ NON_VERBOSE: extreloff 0
537539
NON_VERBOSE: nextrel 0
538540
NON_VERBOSE: locreloff 0
539541
NON_VERBOSE: nlocrel 0
542+
543+
CODESIG: cmd LC_CODE_SIGNATURE
544+
CODESIG: cmdsize 16
545+
CODESIG: dataoff 8496
546+
CODESIG: datasize 64

tools/llvm-objdump/MachODump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8361,7 +8361,7 @@ static void PrintDylibCommand(MachO::dylib_command dl, const char *Ptr) {
83618361
static void PrintLinkEditDataCommand(MachO::linkedit_data_command ld,
83628362
uint32_t object_size) {
83638363
if (ld.cmd == MachO::LC_CODE_SIGNATURE)
8364-
outs() << " cmd LC_FUNCTION_STARTS\n";
8364+
outs() << " cmd LC_CODE_SIGNATURE\n";
83658365
else if (ld.cmd == MachO::LC_SEGMENT_SPLIT_INFO)
83668366
outs() << " cmd LC_SEGMENT_SPLIT_INFO\n";
83678367
else if (ld.cmd == MachO::LC_FUNCTION_STARTS)

0 commit comments

Comments
 (0)