blob: 19f842f381d509f3371c1a6da3a84d8b3ad9618b [file] [log] [blame]
Benjamin Kramer43a772e2011-09-19 17:56:04 +00001//===-- llvm-objdump.h ----------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000010#ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
11#define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
Benjamin Kramer43a772e2011-09-19 17:56:04 +000012
13#include "llvm/ADT/StringRef.h"
14#include "llvm/Support/CommandLine.h"
15#include "llvm/Support/DataTypes.h"
Benjamin Kramer43a772e2011-09-19 17:56:04 +000016
17namespace llvm {
Michael J. Spencer0c6ec482012-12-05 20:12:35 +000018namespace object {
19 class COFFObjectFile;
Tim Northover4bd286a2014-08-01 13:07:19 +000020 class MachOObjectFile;
Michael J. Spencer209565db2013-01-06 03:56:49 +000021 class ObjectFile;
Michael J. Spencer0c6ec482012-12-05 20:12:35 +000022 class RelocationRef;
23}
Michael J. Spencer0c6ec482012-12-05 20:12:35 +000024
Benjamin Kramer43a772e2011-09-19 17:56:04 +000025extern cl::opt<std::string> TripleName;
26extern cl::opt<std::string> ArchName;
Kevin Enderbyc9595622014-08-06 23:24:41 +000027extern cl::opt<std::string> MCPU;
28extern cl::list<std::string> MAttrs;
Kevin Enderbyf6d25852015-01-31 00:37:11 +000029extern cl::list<std::string> DumpSections;
Kevin Enderbye2297dd2015-01-07 21:02:18 +000030extern cl::opt<bool> Disassemble;
Kevin Enderbybf246f52014-09-24 23:08:22 +000031extern cl::opt<bool> NoShowRawInsn;
Kevin Enderbye2297dd2015-01-07 21:02:18 +000032extern cl::opt<bool> PrivateHeaders;
33extern cl::opt<bool> ExportsTrie;
34extern cl::opt<bool> Rebase;
35extern cl::opt<bool> Bind;
36extern cl::opt<bool> LazyBind;
37extern cl::opt<bool> WeakBind;
Kevin Enderby131d1772015-01-09 19:22:37 +000038extern cl::opt<bool> UniversalHeaders;
Kevin Enderby13023a12015-01-15 23:19:11 +000039extern cl::opt<bool> ArchiveHeaders;
Kevin Enderbya7bdc7e2015-01-22 18:55:27 +000040extern cl::opt<bool> IndirectSymbols;
Kevin Enderby69fe98d2015-01-23 18:52:17 +000041extern cl::opt<bool> DataInCode;
Kevin Enderby9a509442015-01-27 21:28:24 +000042extern cl::opt<bool> LinkOptHints;
Kevin Enderby98da6132015-01-20 21:47:46 +000043extern cl::opt<bool> Relocations;
44extern cl::opt<bool> SectionHeaders;
45extern cl::opt<bool> SectionContents;
46extern cl::opt<bool> SymbolTable;
47extern cl::opt<bool> UnwindInfo;
Benjamin Kramer43a772e2011-09-19 17:56:04 +000048
49// Various helper functions.
Rafael Espindolabff5d0d2014-06-13 01:25:41 +000050bool error(std::error_code ec);
Michael J. Spencer0c6ec482012-12-05 20:12:35 +000051bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
Benjamin Kramer43a772e2011-09-19 17:56:04 +000052void DumpBytes(StringRef bytes);
Kevin Enderbye2297dd2015-01-07 21:02:18 +000053void ParseInputMachO(StringRef Filename);
Michael J. Spencer0c6ec482012-12-05 20:12:35 +000054void printCOFFUnwindInfo(const object::COFFObjectFile* o);
Tim Northover4bd286a2014-08-01 13:07:19 +000055void printMachOUnwindInfo(const object::MachOObjectFile* o);
Nick Kledzikd04bc352014-08-30 00:20:14 +000056void printMachOExportsTrie(const object::MachOObjectFile* o);
Nick Kledzikac431442014-09-12 21:34:15 +000057void printMachORebaseTable(const object::MachOObjectFile* o);
Nick Kledzik56ebef42014-09-16 01:41:51 +000058void printMachOBindTable(const object::MachOObjectFile* o);
59void printMachOLazyBindTable(const object::MachOObjectFile* o);
60void printMachOWeakBindTable(const object::MachOObjectFile* o);
Michael J. Spencer209565db2013-01-06 03:56:49 +000061void printELFFileHeader(const object::ObjectFile *o);
Rui Ueyamac2bed422013-09-27 21:04:00 +000062void printCOFFFileHeader(const object::ObjectFile *o);
Kevin Enderbyb76d3862014-08-22 20:35:18 +000063void printMachOFileHeader(const object::ObjectFile *o);
Kevin Enderbye2297dd2015-01-07 21:02:18 +000064void printExportsTrie(const object::ObjectFile *o);
65void printRebaseTable(const object::ObjectFile *o);
66void printBindTable(const object::ObjectFile *o);
67void printLazyBindTable(const object::ObjectFile *o);
68void printWeakBindTable(const object::ObjectFile *o);
Kevin Enderby98da6132015-01-20 21:47:46 +000069void PrintRelocations(const object::ObjectFile *o);
70void PrintSectionHeaders(const object::ObjectFile *o);
71void PrintSectionContents(const object::ObjectFile *o);
72void PrintSymbolTable(const object::ObjectFile *o);
Benjamin Kramer43a772e2011-09-19 17:56:04 +000073
Rui Ueyamac2bed422013-09-27 21:04:00 +000074} // end namespace llvm
Benjamin Kramer43a772e2011-09-19 17:56:04 +000075
76#endif