diff options
author | Colin LeMahieu <colinl@codeaurora.org> | 2015-07-23 20:58:49 +0000 |
---|---|---|
committer | Colin LeMahieu <colinl@codeaurora.org> | 2015-07-23 20:58:49 +0000 |
commit | f34933e425a9b04e837766b47719892d4352f4be (patch) | |
tree | a67c1b8ef01ec0d1935c330e8041fe169361821f /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 878c144f8a32336daa2c0124017ec707924cfcc0 (diff) | |
download | bcm5719-llvm-f34933e425a9b04e837766b47719892d4352f4be.tar.gz bcm5719-llvm-f34933e425a9b04e837766b47719892d4352f4be.zip |
[llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly on all sections instead of just text sections.
llvm-svn: 243041
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 275eb9c6a45..91626c15d87 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -70,7 +70,14 @@ llvm::Disassemble("disassemble", cl::desc("Display assembler mnemonics for the machine instructions")); static cl::alias Disassembled("d", cl::desc("Alias for --disassemble"), - cl::aliasopt(Disassemble)); + cl::aliasopt(Disassemble));
+
+cl::opt<bool>
+llvm::DisassembleAll("disassemble-all",
+ cl::desc("Display assembler mnemonics for the machine instructions"));
+static cl::alias
+DisassembleAlld("D", cl::desc("Alias for --disassemble-all"),
+ cl::aliasopt(DisassembleAll)); cl::opt<bool> llvm::Relocations("r", cl::desc("Display the relocation entries in the file")); @@ -837,7 +844,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { } for (const SectionRef &Section : Obj->sections()) { - if (!Section.isText() || Section.isVirtual()) + if (!DisassembleAll && (!Section.isText() || Section.isVirtual())) continue; uint64_t SectionAddr = Section.getAddress(); @@ -1514,6 +1521,8 @@ int main(int argc, char **argv) { if (InputFilenames.size() == 0) InputFilenames.push_back("a.out"); + if (DisassembleAll) + Disassemble = true; if (!Disassemble && !Relocations && !SectionHeaders |