aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/MachODump.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-04-28 20:14:13 +0000
committerKevin Enderby <enderby@apple.com>2016-04-28 20:14:13 +0000
commit4b627beea86a50b67cd8346fb4e35374576ad01d (patch)
tree81eb7f7a16445c95bf63723593a16195adbc82e9 /llvm/tools/llvm-objdump/MachODump.cpp
parent84c3a8ba3dfcb0771ea6bbbd3bbb53e7b0e8d1a3 (diff)
downloadllvm-4b627beea86a50b67cd8346fb4e35374576ad01d.zip
llvm-4b627beea86a50b67cd8346fb4e35374576ad01d.tar.gz
llvm-4b627beea86a50b67cd8346fb4e35374576ad01d.tar.bz2
Update llvm-objdump for disassembly of ARM Mach-O files to always include the opcode bytes.
As this is the expected behavior of the old darwin otool(1) for ARM Mach-O files. rdar://25896249 llvm-svn: 267929
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index bcce08e..1632e37 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -6215,6 +6215,8 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
ThumbSymbolizerInfo.adrp_addr = 0;
ThumbSymbolizerInfo.adrp_inst = 0;
+ unsigned int Arch = MachOOF->getArch();
+
// Disassemble symbol by symbol.
for (unsigned SymIdx = 0; SymIdx != Symbols.size(); SymIdx++) {
Expected<StringRef> SymNameOrErr = Symbols[SymIdx].getName();
@@ -6297,7 +6299,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
outs() << format("%8" PRIx64 ":", PC);
}
}
- if (!NoShowRawInsn)
+ if (!NoShowRawInsn || Arch == Triple::arm)
outs() << "\t";
// Check the data in code table here to see if this is data not an
@@ -6330,7 +6332,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
gotInst = DisAsm->getInstruction(Inst, Size, Bytes.slice(Index), PC,
DebugOut, Annotations);
if (gotInst) {
- if (!NoShowRawInsn) {
+ if (!NoShowRawInsn || Arch == Triple::arm) {
dumpBytes(makeArrayRef(Bytes.data() + Index, Size), outs());
}
formatted_raw_ostream FormattedOS(outs());
@@ -6400,7 +6402,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF,
outs() << format("%8" PRIx64 ":", PC);
}
}
- if (!NoShowRawInsn) {
+ if (!NoShowRawInsn || Arch == Triple::arm) {
outs() << "\t";
dumpBytes(makeArrayRef(Bytes.data() + Index, InstSize), outs());
}