1 // 2 // The LLVM Compiler Infrastructure 3 // 4 // This file is distributed under the University of Illinois Open Source 5 // License. See LICENSE.TXT for details. 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H 10 #define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H 11 12 #include "llvm/ADT/StringRef.h" 13 #include "llvm/Support/CommandLine.h" 14 #include "llvm/Support/DataTypes.h" 15 16 namespace llvm { 17 namespace object { 18 class COFFObjectFile; 19 class MachOObjectFile; 20 class ObjectFile; 21 class RelocationRef; 22 } 23 24 extern cl::opt<std::string> TripleName; 25 extern cl::opt<std::string> ArchName; 26 extern cl::opt<std::string> MCPU; 27 extern cl::list<std::string> MAttrs; 28 extern cl::list<std::string> DumpSections; 29 extern cl::opt<bool> Raw; 30 extern cl::opt<bool> Disassemble; 31 extern cl::opt<bool> NoShowRawInsn; 32 extern cl::opt<bool> PrivateHeaders; 33 extern cl::opt<bool> ExportsTrie; 34 extern cl::opt<bool> Rebase; 35 extern cl::opt<bool> Bind; 36 extern cl::opt<bool> LazyBind; 37 extern cl::opt<bool> WeakBind; 38 extern cl::opt<bool> UniversalHeaders; 39 extern cl::opt<bool> ArchiveHeaders; 40 extern cl::opt<bool> IndirectSymbols; 41 extern cl::opt<bool> DataInCode; 42 extern cl::opt<bool> LinkOptHints; 43 extern cl::opt<bool> InfoPlist; 44 extern cl::opt<bool> DylibsUsed; 45 extern cl::opt<bool> DylibId; 46 extern cl::opt<bool> ObjcMetaData; 47 extern cl::opt<std::string> DisSymName; 48 extern cl::opt<bool> NonVerbose; 49 extern cl::opt<bool> Relocations; 50 extern cl::opt<bool> SectionHeaders; 51 extern cl::opt<bool> SectionContents; 52 extern cl::opt<bool> SymbolTable; 53 extern cl::opt<bool> UnwindInfo; 54 55 // Various helper functions. 56 bool error(std::error_code ec); 57 bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b); 58 void DumpBytes(ArrayRef<uint8_t> bytes); 59 void ParseInputMachO(StringRef Filename); 60 void printCOFFUnwindInfo(const object::COFFObjectFile* o); 61 void printMachOUnwindInfo(const object::MachOObjectFile* o); 62 void printMachOExportsTrie(const object::MachOObjectFile* o); 63 void printMachORebaseTable(const object::MachOObjectFile* o); 64 void printMachOBindTable(const object::MachOObjectFile* o); 65 void printMachOLazyBindTable(const object::MachOObjectFile* o); 66 void printMachOWeakBindTable(const object::MachOObjectFile* o); 67 void printELFFileHeader(const object::ObjectFile *o); 68 void printCOFFFileHeader(const object::ObjectFile *o); 69 void printMachOFileHeader(const object::ObjectFile *o); 70 void printExportsTrie(const object::ObjectFile *o); 71 void printRebaseTable(const object::ObjectFile *o); 72 void printBindTable(const object::ObjectFile *o); 73 void printLazyBindTable(const object::ObjectFile *o); 74 void printWeakBindTable(const object::ObjectFile *o); 75 void PrintRelocations(const object::ObjectFile *o); 76 void PrintSectionHeaders(const object::ObjectFile *o); 77 void PrintSectionContents(const object::ObjectFile *o); 78 void PrintSymbolTable(const object::ObjectFile *o); 79 80 } // end namespace llvm 81 82 #endif 83