summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-11-29 21:43:40 +0000
committerKevin Enderby <enderby@apple.com>2016-11-29 21:43:40 +0000
commitf9d60f00e516358a33dc1b0e65a7ce6dd94cc188 (patch)
tree6a87d193d753ffe689b7f9484ca03818c6c555d7 /llvm/tools
parent9303efb0afb6c2d904d4d9d5277ad58c14b067f7 (diff)
downloadbcm5719-llvm-f9d60f00e516358a33dc1b0e65a7ce6dd94cc188.tar.gz
bcm5719-llvm-f9d60f00e516358a33dc1b0e65a7ce6dd94cc188.zip
Add to llvm-objdump the -no-leading-headers option with the use of the -macho option.
In some cases the leading headers of the file name, archive member and architecture slice name in the output of lvm-objdump is not wanted so the tool’s output can be directly used by scripts. This matches the -X option of the Apple otool(1) program. rdar://28491674 llvm-svn: 288199
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 4e5241c5c50..b196170d4f7 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -71,6 +71,9 @@ static cl::opt<bool> FullLeadingAddr("full-leading-addr",
static cl::opt<bool> NoLeadingAddr("no-leading-addr",
cl::desc("Print no leading address"));
+static cl::opt<bool> NoLeadingHeaders("no-leading-headers",
+ cl::desc("Print no leading headers"));
+
cl::opt<bool> llvm::UniversalHeaders("universal-headers",
cl::desc("Print Mach-O universal headers "
"(requires -macho)"));
@@ -1190,12 +1193,14 @@ static void ProcessMachO(StringRef Name, MachOObjectFile *MachOOF,
if (Disassemble || PrivateHeaders || ExportsTrie || Rebase || Bind || SymbolTable ||
LazyBind || WeakBind || IndirectSymbols || DataInCode || LinkOptHints ||
DylibsUsed || DylibId || ObjcMetaData || (FilterSections.size() != 0)) {
- outs() << Name;
- if (!ArchiveMemberName.empty())
- outs() << '(' << ArchiveMemberName << ')';
- if (!ArchitectureName.empty())
- outs() << " (architecture " << ArchitectureName << ")";
- outs() << ":\n";
+ if (!NoLeadingHeaders) {
+ outs() << Name;
+ if (!ArchiveMemberName.empty())
+ outs() << '(' << ArchiveMemberName << ')';
+ if (!ArchitectureName.empty())
+ outs() << " (architecture " << ArchitectureName << ")";
+ outs() << ":\n";
+ }
}
// To use the report_error() form with an ArchiveName and FileName set
// these up based on what is passed for Name and ArchiveMemberName.
OpenPOWER on IntegriCloud