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

Commit 595b083

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 (cherry picked from commit bfb3d23)
1 parent 6d5d4f6 commit 595b083

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
@@ -8262,7 +8262,7 @@ static void PrintDylibCommand(MachO::dylib_command dl, const char *Ptr) {
82628262
static void PrintLinkEditDataCommand(MachO::linkedit_data_command ld,
82638263
uint32_t object_size) {
82648264
if (ld.cmd == MachO::LC_CODE_SIGNATURE)
8265-
outs() << " cmd LC_FUNCTION_STARTS\n";
8265+
outs() << " cmd LC_CODE_SIGNATURE\n";
82668266
else if (ld.cmd == MachO::LC_SEGMENT_SPLIT_INFO)
82678267
outs() << " cmd LC_SEGMENT_SPLIT_INFO\n";
82688268
else if (ld.cmd == MachO::LC_FUNCTION_STARTS)

0 commit comments

Comments
 (0)