--- /dev/null
+// This test checks that -D disassembles from a data section
+// RUN: llvm-mc -filetype=obj -o - %s | llvm-objdump -D - | FileCheck %s
+
+// CHECK: Disassembly of section .data:
+.data
+.word 0x0
\ No newline at end of file
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));\r
+\r
+cl::opt<bool>\r
+llvm::DisassembleAll("disassemble-all",\r
+ cl::desc("Display assembler mnemonics for the machine instructions"));\r
+static cl::alias\r
+DisassembleAlld("D", cl::desc("Alias for --disassemble-all"),\r
+ cl::aliasopt(DisassembleAll));
cl::opt<bool>
llvm::Relocations("r", cl::desc("Display the relocation entries in the file"));
}
for (const SectionRef &Section : Obj->sections()) {
- if (!Section.isText() || Section.isVirtual())
+ if (!DisassembleAll && (!Section.isText() || Section.isVirtual()))
continue;
uint64_t SectionAddr = Section.getAddress();
if (InputFilenames.size() == 0)
InputFilenames.push_back("a.out");
+ if (DisassembleAll)
+ Disassemble = true;
if (!Disassemble
&& !Relocations
&& !SectionHeaders
extern cl::opt<std::string> MCPU;
extern cl::list<std::string> MAttrs;
extern cl::list<std::string> DumpSections;
-extern cl::opt<bool> Disassemble;
+extern cl::opt<bool> Disassemble;\r
+extern cl::opt<bool> DisassembleAll;
extern cl::opt<bool> NoShowRawInsn;
extern cl::opt<bool> PrivateHeaders;
extern cl::opt<bool> ExportsTrie;