From 21b864cd127e9df186e33858f4787d015b54a5f9 Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Tue, 20 Jun 2017 21:00:25 +0000 Subject: [PATCH] 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 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 | 4 ++++ tools/llvm-objdump/MachODump.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/tools/llvm-objdump/X86/macho-info-plist.test b/test/tools/llvm-objdump/X86/macho-info-plist.test index bee1952ce9b..7550af905b7 100644 --- a/test/tools/llvm-objdump/X86/macho-info-plist.test +++ b/test/tools/llvm-objdump/X86/macho-info-plist.test @@ -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 "\n" # CHECK: Contents of (__TEXT,__info_plist) section # CHECK: + +# NOHEADER-NOT: Contents of (__TEXT,__info_plist) section +# NOHEADER: diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index 22b9869fe92..99d2dbd3017 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -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(BytesStr.data()); -- 2.50.1