[llvm] r305849 - Change llvm-objdump with Mach-O files and the -info-plist option with the

Kevin Enderby via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 14:00:25 PDT 2017


Author: enderby
Date: Tue Jun 20 16:00:25 2017
New Revision: 305849

URL: http://llvm.org/viewvc/llvm-project?rev=305849&view=rev
Log:
Change llvm-objdump with Mach-O files and the -info-plist option with the
-no-leading-headers option so that it does not print the leading header.

rdar://27378808

Modified:
    llvm/trunk/test/tools/llvm-objdump/X86/macho-info-plist.test
    llvm/trunk/tools/llvm-objdump/MachODump.cpp

Modified: llvm/trunk/test/tools/llvm-objdump/X86/macho-info-plist.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/macho-info-plist.test?rev=305849&r1=305848&r2=305849&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/macho-info-plist.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/macho-info-plist.test Tue Jun 20 16:00:25 2017
@@ -1,7 +1,11 @@
 # RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -info-plist - | FileCheck %s
+# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -info-plist -no-leading-headers - | FileCheck --check-prefix=NOHEADER %s
 
 .section __TEXT, __info_plist
 .asciz "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
 
 # CHECK: Contents of (__TEXT,__info_plist) section
 # CHECK: <?xml version="1.0" encoding="UTF-8"?>
+
+# NOHEADER-NOT: Contents of (__TEXT,__info_plist) section
+# NOHEADER: <?xml version="1.0" encoding="UTF-8"?>

Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=305849&r1=305848&r2=305849&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Tue Jun 20 16:00:25 2017
@@ -1135,7 +1135,8 @@ static void DumpInfoPlistSectionContents
     DataRefImpl Ref = Section.getRawDataRefImpl();
     StringRef SegName = O->getSectionFinalSegmentName(Ref);
     if (SegName == "__TEXT" && SectName == "__info_plist") {
-      outs() << "Contents of (" << SegName << "," << SectName << ") section\n";
+      if (!NoLeadingHeaders)
+        outs() << "Contents of (" << SegName << "," << SectName << ") section\n";
       StringRef BytesStr;
       Section.getContents(BytesStr);
       const char *sect = reinterpret_cast<const char *>(BytesStr.data());




More information about the llvm-commits mailing list