+namespace opts {
+ cl::list<std::string> InputFilenames(cl::Positional,
+ cl::desc("<input object files>"),
+ cl::ZeroOrMore);
+
+ // -file-headers, -h
+ cl::opt<bool> FileHeaders("file-headers",
+ cl::desc("Display file headers "));
+ cl::alias FileHeadersShort("h",
+ cl::desc("Alias for --file-headers"),
+ cl::aliasopt(FileHeaders));
+
+ // -sections, -s
+ cl::opt<bool> Sections("sections",
+ cl::desc("Display all sections."));
+ cl::alias SectionsShort("s",
+ cl::desc("Alias for --sections"),
+ cl::aliasopt(Sections));
+
+ // -section-relocations, -sr
+ cl::opt<bool> SectionRelocations("section-relocations",
+ cl::desc("Display relocations for each section shown."));
+ cl::alias SectionRelocationsShort("sr",
+ cl::desc("Alias for --section-relocations"),
+ cl::aliasopt(SectionRelocations));
+
+ // -section-symbols, -st
+ cl::opt<bool> SectionSymbols("section-symbols",
+ cl::desc("Display symbols for each section shown."));
+ cl::alias SectionSymbolsShort("st",
+ cl::desc("Alias for --section-symbols"),
+ cl::aliasopt(SectionSymbols));
+
+ // -section-data, -sd
+ cl::opt<bool> SectionData("section-data",
+ cl::desc("Display section data for each section shown."));
+ cl::alias SectionDataShort("sd",
+ cl::desc("Alias for --section-data"),
+ cl::aliasopt(SectionData));
+
+ // -relocations, -r
+ cl::opt<bool> Relocations("relocations",
+ cl::desc("Display the relocation entries in the file"));
+ cl::alias RelocationsShort("r",
+ cl::desc("Alias for --relocations"),
+ cl::aliasopt(Relocations));
+
+ // -dyn-relocations
+ cl::opt<bool> DynRelocs("dyn-relocations",
+ cl::desc("Display the dynamic relocation entries in the file"));
+
+ // -symbols, -t
+ cl::opt<bool> Symbols("symbols",
+ cl::desc("Display the symbol table"));
+ cl::alias SymbolsShort("t",
+ cl::desc("Alias for --symbols"),
+ cl::aliasopt(Symbols));
+
+ // -dyn-symbols, -dt
+ cl::opt<bool> DynamicSymbols("dyn-symbols",
+ cl::desc("Display the dynamic symbol table"));
+ cl::alias DynamicSymbolsShort("dt",
+ cl::desc("Alias for --dyn-symbols"),
+ cl::aliasopt(DynamicSymbols));
+
+ // -unwind, -u
+ cl::opt<bool> UnwindInfo("unwind",
+ cl::desc("Display unwind information"));
+ cl::alias UnwindInfoShort("u",
+ cl::desc("Alias for --unwind"),
+ cl::aliasopt(UnwindInfo));
+
+ // -dynamic-table
+ cl::opt<bool> DynamicTable("dynamic-table",
+ cl::desc("Display the ELF .dynamic section table"));
+
+ // -needed-libs
+ cl::opt<bool> NeededLibraries("needed-libs",
+ cl::desc("Display the needed libraries"));
+
+ // -program-headers
+ cl::opt<bool> ProgramHeaders("program-headers",
+ cl::desc("Display ELF program headers"));
+
+ // -hash-table
+ cl::opt<bool> HashTable("hash-table",
+ cl::desc("Display ELF hash table"));
+
+ // -gnu-hash-table
+ cl::opt<bool> GnuHashTable("gnu-hash-table",
+ cl::desc("Display ELF .gnu.hash section"));
+
+ // -expand-relocs
+ cl::opt<bool> ExpandRelocs("expand-relocs",
+ cl::desc("Expand each shown relocation to multiple lines"));
+
+ // -codeview
+ cl::opt<bool> CodeView("codeview",
+ cl::desc("Display CodeView debug information"));
+
+ // -codeview-subsection-bytes
+ cl::opt<bool> CodeViewSubsectionBytes(
+ "codeview-subsection-bytes",
+ cl::desc("Dump raw contents of codeview debug sections and records"));
+
+ // -arm-attributes, -a
+ cl::opt<bool> ARMAttributes("arm-attributes",
+ cl::desc("Display the ARM attributes section"));
+ cl::alias ARMAttributesShort("-a", cl::desc("Alias for --arm-attributes"),
+ cl::aliasopt(ARMAttributes));
+
+ // -mips-plt-got
+ cl::opt<bool>
+ MipsPLTGOT("mips-plt-got",
+ cl::desc("Display the MIPS GOT and PLT GOT sections"));
+
+ // -mips-abi-flags
+ cl::opt<bool> MipsABIFlags("mips-abi-flags",
+ cl::desc("Display the MIPS.abiflags section"));
+
+ // -mips-reginfo
+ cl::opt<bool> MipsReginfo("mips-reginfo",
+ cl::desc("Display the MIPS .reginfo section"));
+
+ // -coff-imports
+ cl::opt<bool>
+ COFFImports("coff-imports", cl::desc("Display the PE/COFF import table"));
+
+ // -coff-exports
+ cl::opt<bool>
+ COFFExports("coff-exports", cl::desc("Display the PE/COFF export table"));
+
+ // -coff-directives
+ cl::opt<bool>
+ COFFDirectives("coff-directives",
+ cl::desc("Display the PE/COFF .drectve section"));
+
+ // -coff-basereloc
+ cl::opt<bool>
+ COFFBaseRelocs("coff-basereloc",
+ cl::desc("Display the PE/COFF .reloc section"));
+
+ // -macho-data-in-code
+ cl::opt<bool>
+ MachODataInCode("macho-data-in-code",
+ cl::desc("Display MachO Data in Code command"));
+
+ // -macho-indirect-symbols
+ cl::opt<bool>
+ MachOIndirectSymbols("macho-indirect-symbols",
+ cl::desc("Display MachO indirect symbols"));
+
+ // -macho-linker-options
+ cl::opt<bool>
+ MachOLinkerOptions("macho-linker-options",
+ cl::desc("Display MachO linker options"));
+
+ // -macho-segment
+ cl::opt<bool>
+ MachOSegment("macho-segment",
+ cl::desc("Display MachO Segment command"));
+
+ // -macho-version-min
+ cl::opt<bool>
+ MachOVersionMin("macho-version-min",
+ cl::desc("Display MachO version min command"));
+
+ // -macho-dysymtab
+ cl::opt<bool>
+ MachODysymtab("macho-dysymtab",
+ cl::desc("Display MachO Dysymtab command"));
+
+ // -stackmap
+ cl::opt<bool>
+ PrintStackMap("stackmap",
+ cl::desc("Display contents of stackmap section"));
+
+ // -version-info
+ cl::opt<bool>
+ VersionInfo("version-info",
+ cl::desc("Display ELF version sections (if present)"));
+ cl::alias VersionInfoShort("V", cl::desc("Alias for -version-info"),
+ cl::aliasopt(VersionInfo));
+} // namespace opts
+
+namespace llvm {
+
+LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg) {
+ outs() << "\nError reading file: " << Msg << ".\n";
+ outs().flush();
+ exit(1);