]> granicus.if.org Git - llvm/commitdiff
Change llvm-objdump with Mach-O files and the -info-plist option with the
authorKevin Enderby <enderby@apple.com>
Tue, 20 Jun 2017 21:00:25 +0000 (21:00 +0000)
committerKevin Enderby <enderby@apple.com>
Tue, 20 Jun 2017 21:00:25 +0000 (21:00 +0000)
-no-leading-headers option so that it does not print the leading header.

rdar://27378808

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305849 91177308-0d34-0410-b5e6-96231b3b80d8

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

index bee1952ce9b823a033c6377099c705a1b2c484ba..7550af905b7e643ebda79b335b5c10f0c45b7362 100644 (file)
@@ -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"?>
index 22b9869fe92645af197d6c349db1050b09da677b..99d2dbd3017908f288900e8a77de4536e70dfbb3 100644 (file)
@@ -1135,7 +1135,8 @@ static void DumpInfoPlistSectionContents(StringRef Filename,
     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());