xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-objdump/MachODump.h (revision d9a42747950146bf03cda7f6e25d219253f8a57a)
1 //===-- MachODump.h ---------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_TOOLS_LLVM_OBJDUMP_MACHODUMP_H
10 #define LLVM_TOOLS_LLVM_OBJDUMP_MACHODUMP_H
11 
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/Support/CommandLine.h"
14 
15 namespace llvm {
16 
17 class Error;
18 class StringRef;
19 
20 namespace object {
21 class MachOObjectFile;
22 class MachOUniversalBinary;
23 class ObjectFile;
24 class RelocationRef;
25 } // namespace object
26 
27 namespace opt {
28 class InputArgList;
29 } // namespace opt
30 
31 namespace objdump {
32 
33 void parseMachOOptions(const llvm::opt::InputArgList &InputArgs);
34 
35 // MachO specific options
36 extern bool Bind;
37 extern bool DataInCode;
38 extern std::string DisSymName;
39 extern bool DyldInfo;
40 extern bool DylibId;
41 extern bool DylibsUsed;
42 extern bool ExportsTrie;
43 extern bool FirstPrivateHeader;
44 extern bool FullLeadingAddr;
45 extern bool FunctionStarts;
46 extern bool IndirectSymbols;
47 extern bool InfoPlist;
48 extern bool LazyBind;
49 extern bool LeadingHeaders;
50 extern bool LinkOptHints;
51 extern bool ObjcMetaData;
52 extern bool Rebase;
53 extern bool Rpaths;
54 extern bool SymbolicOperands;
55 extern bool UniversalHeaders;
56 extern bool Verbose;
57 extern bool WeakBind;
58 
59 Error getMachORelocationValueString(const object::MachOObjectFile *Obj,
60                                     const object::RelocationRef &RelRef,
61                                     llvm::SmallVectorImpl<char> &Result);
62 
63 void parseInputMachO(StringRef Filename);
64 void parseInputMachO(object::MachOUniversalBinary *UB);
65 
66 void printMachOUnwindInfo(const object::MachOObjectFile *O);
67 void printMachOFileHeader(const object::ObjectFile *O);
68 void printMachOLoadCommands(const object::ObjectFile *O);
69 
70 void printExportsTrie(const object::ObjectFile *O);
71 void printRebaseTable(object::ObjectFile *O);
72 void printBindTable(object::ObjectFile *O);
73 void printLazyBindTable(object::ObjectFile *O);
74 void printWeakBindTable(object::ObjectFile *O);
75 
76 } // namespace objdump
77 } // namespace llvm
78 
79 #endif
80