Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 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 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 9 | #ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H |
| 10 | #define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 11 | |
| 12 | #include "llvm/ADT/StringRef.h" |
| 13 | #include "llvm/Support/CommandLine.h" |
| 14 | #include "llvm/Support/DataTypes.h" |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 15 | |
| 16 | namespace llvm { |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 17 | namespace object { |
| 18 | class COFFObjectFile; |
Tim Northover | 4bd286a | 2014-08-01 13:07:19 +0000 | [diff] [blame] | 19 | class MachOObjectFile; |
Michael J. Spencer | 209565db | 2013-01-06 03:56:49 +0000 | [diff] [blame] | 20 | class ObjectFile; |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 21 | class RelocationRef; |
| 22 | } |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 23 | |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 24 | extern cl::opt<std::string> TripleName; |
| 25 | extern cl::opt<std::string> ArchName; |
Kevin Enderby | c959562 | 2014-08-06 23:24:41 +0000 | [diff] [blame] | 26 | extern cl::opt<std::string> MCPU; |
| 27 | extern cl::list<std::string> MAttrs; |
Kevin Enderby | f6d2585 | 2015-01-31 00:37:11 +0000 | [diff] [blame] | 28 | extern cl::list<std::string> DumpSections; |
Adrian Prantl | c2401dd | 2015-03-27 17:31:15 +0000 | [diff] [blame] | 29 | extern cl::opt<bool> Raw; |
Kevin Enderby | e2297dd | 2015-01-07 21:02:18 +0000 | [diff] [blame] | 30 | extern cl::opt<bool> Disassemble; |
Kevin Enderby | bf246f5 | 2014-09-24 23:08:22 +0000 | [diff] [blame] | 31 | extern cl::opt<bool> NoShowRawInsn; |
Kevin Enderby | e2297dd | 2015-01-07 21:02:18 +0000 | [diff] [blame] | 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; |
Kevin Enderby | 131d177 | 2015-01-09 19:22:37 +0000 | [diff] [blame] | 38 | extern cl::opt<bool> UniversalHeaders; |
Kevin Enderby | 13023a1 | 2015-01-15 23:19:11 +0000 | [diff] [blame] | 39 | extern cl::opt<bool> ArchiveHeaders; |
Kevin Enderby | a7bdc7e | 2015-01-22 18:55:27 +0000 | [diff] [blame] | 40 | extern cl::opt<bool> IndirectSymbols; |
Kevin Enderby | 69fe98d | 2015-01-23 18:52:17 +0000 | [diff] [blame] | 41 | extern cl::opt<bool> DataInCode; |
Kevin Enderby | 9a50944 | 2015-01-27 21:28:24 +0000 | [diff] [blame] | 42 | extern cl::opt<bool> LinkOptHints; |
Kevin Enderby | cd66be5 | 2015-03-11 22:06:32 +0000 | [diff] [blame] | 43 | extern cl::opt<bool> InfoPlist; |
Kevin Enderby | bc847fa | 2015-03-16 20:08:09 +0000 | [diff] [blame] | 44 | extern cl::opt<bool> DylibsUsed; |
| 45 | extern cl::opt<bool> DylibId; |
Kevin Enderby | 0fc1182 | 2015-04-01 20:57:01 +0000 | [diff] [blame] | 46 | extern cl::opt<bool> ObjcMetaData; |
Kevin Enderby | 6a22175 | 2015-03-17 17:10:57 +0000 | [diff] [blame] | 47 | extern cl::opt<std::string> DisSymName; |
Kevin Enderby | f064075 | 2015-03-13 17:56:32 +0000 | [diff] [blame] | 48 | extern cl::opt<bool> NonVerbose; |
Kevin Enderby | 98da613 | 2015-01-20 21:47:46 +0000 | [diff] [blame] | 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; |
Colin LeMahieu | 14ec76e | 2015-06-07 21:07:17 +0000 | [diff] [blame^] | 54 | extern cl::opt<bool> PrintImmHex; |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 55 | |
| 56 | // Various helper functions. |
Rafael Espindola | bff5d0d | 2014-06-13 01:25:41 +0000 | [diff] [blame] | 57 | bool error(std::error_code ec); |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 58 | bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b); |
Kevin Enderby | e2297dd | 2015-01-07 21:02:18 +0000 | [diff] [blame] | 59 | void ParseInputMachO(StringRef Filename); |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 60 | void printCOFFUnwindInfo(const object::COFFObjectFile* o); |
Tim Northover | 4bd286a | 2014-08-01 13:07:19 +0000 | [diff] [blame] | 61 | void printMachOUnwindInfo(const object::MachOObjectFile* o); |
Nick Kledzik | d04bc35 | 2014-08-30 00:20:14 +0000 | [diff] [blame] | 62 | void printMachOExportsTrie(const object::MachOObjectFile* o); |
Nick Kledzik | ac43144 | 2014-09-12 21:34:15 +0000 | [diff] [blame] | 63 | void printMachORebaseTable(const object::MachOObjectFile* o); |
Nick Kledzik | 56ebef4 | 2014-09-16 01:41:51 +0000 | [diff] [blame] | 64 | void printMachOBindTable(const object::MachOObjectFile* o); |
| 65 | void printMachOLazyBindTable(const object::MachOObjectFile* o); |
| 66 | void printMachOWeakBindTable(const object::MachOObjectFile* o); |
Michael J. Spencer | 209565db | 2013-01-06 03:56:49 +0000 | [diff] [blame] | 67 | void printELFFileHeader(const object::ObjectFile *o); |
Rui Ueyama | c2bed42 | 2013-09-27 21:04:00 +0000 | [diff] [blame] | 68 | void printCOFFFileHeader(const object::ObjectFile *o); |
Kevin Enderby | b76d386 | 2014-08-22 20:35:18 +0000 | [diff] [blame] | 69 | void printMachOFileHeader(const object::ObjectFile *o); |
Kevin Enderby | e2297dd | 2015-01-07 21:02:18 +0000 | [diff] [blame] | 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); |
Kevin Enderby | 98da613 | 2015-01-20 21:47:46 +0000 | [diff] [blame] | 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); |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 79 | |
Rui Ueyama | c2bed42 | 2013-09-27 21:04:00 +0000 | [diff] [blame] | 80 | } // end namespace llvm |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 81 | |
| 82 | #endif |