[llvm] r267940 - Fix a bug in llvm-objdump for -private-headers printing the LC_CODE_SIGNATURE Mach-O load command.

Kevin Enderby via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 14:07:20 PDT 2016


Author: enderby
Date: Thu Apr 28 16:07:20 2016
New Revision: 267940

URL: http://llvm.org/viewvc/llvm-project?rev=267940&view=rev
Log:
Fix a bug in llvm-objdump for -private-headers printing the LC_CODE_SIGNATURE Mach-O load command.

rdar://25985653

Added:
    llvm/trunk/test/tools/llvm-objdump/X86/Inputs/codesig.macho-x86_64   (with props)
Modified:
    llvm/trunk/test/tools/llvm-objdump/X86/macho-private-headers.test
    llvm/trunk/tools/llvm-objdump/MachODump.cpp

Added: llvm/trunk/test/tools/llvm-objdump/X86/Inputs/codesig.macho-x86_64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/Inputs/codesig.macho-x86_64?rev=267940&view=auto
==============================================================================
Binary file - no diff available.

Propchange: llvm/trunk/test/tools/llvm-objdump/X86/Inputs/codesig.macho-x86_64
------------------------------------------------------------------------------
    svn:executable = *

Propchange: llvm/trunk/test/tools/llvm-objdump/X86/Inputs/codesig.macho-x86_64
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: llvm/trunk/test/tools/llvm-objdump/X86/macho-private-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/macho-private-headers.test?rev=267940&r1=267939&r2=267940&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/macho-private-headers.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/macho-private-headers.test Thu Apr 28 16:07:20 2016
@@ -21,6 +21,8 @@
 // RUN:     | FileCheck %s -check-prefix=FATi386
 // RUN: llvm-objdump -p -non-verbose %p/Inputs/hello.obj.macho-x86_64 \
 // RUN:     | FileCheck %s -check-prefix=NON_VERBOSE
+// RUN: llvm-objdump -p %p/Inputs/codesig.macho-x86_64 \
+// RUN:     | FileCheck %s -check-prefix=CODESIG
 
 CHECK: Mach header
 CHECK:       magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
@@ -537,3 +539,8 @@ NON_VERBOSE:       extreloff 0
 NON_VERBOSE:         nextrel 0
 NON_VERBOSE:       locreloff 0
 NON_VERBOSE:         nlocrel 0
+
+CODESIG:      cmd LC_CODE_SIGNATURE
+CODESIG:  cmdsize 16
+CODESIG:  dataoff 8496
+CODESIG: datasize 64

Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=267940&r1=267939&r2=267940&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Thu Apr 28 16:07:20 2016
@@ -8361,7 +8361,7 @@ static void PrintDylibCommand(MachO::dyl
 static void PrintLinkEditDataCommand(MachO::linkedit_data_command ld,
                                      uint32_t object_size) {
   if (ld.cmd == MachO::LC_CODE_SIGNATURE)
-    outs() << "      cmd LC_FUNCTION_STARTS\n";
+    outs() << "      cmd LC_CODE_SIGNATURE\n";
   else if (ld.cmd == MachO::LC_SEGMENT_SPLIT_INFO)
     outs() << "      cmd LC_SEGMENT_SPLIT_INFO\n";
   else if (ld.cmd == MachO::LC_FUNCTION_STARTS)




More information about the llvm-commits mailing list