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 DylibId; 40 extern bool DylibsUsed; 41 extern bool ExportsTrie; 42 extern bool FirstPrivateHeader; 43 extern bool FullLeadingAddr; 44 extern bool FunctionStarts; 45 extern bool IndirectSymbols; 46 extern bool InfoPlist; 47 extern bool LazyBind; 48 extern bool LeadingHeaders; 49 extern bool LinkOptHints; 50 extern bool ObjcMetaData; 51 extern bool Rebase; 52 extern bool Rpaths; 53 extern bool SymbolicOperands; 54 extern bool UniversalHeaders; 55 extern bool Verbose; 56 extern bool WeakBind; 57 58 Error getMachORelocationValueString(const object::MachOObjectFile *Obj, 59 const object::RelocationRef &RelRef, 60 llvm::SmallVectorImpl<char> &Result); 61 62 void parseInputMachO(StringRef Filename); 63 void parseInputMachO(object::MachOUniversalBinary *UB); 64 65 void printMachOUnwindInfo(const object::MachOObjectFile *O); 66 void printMachOFileHeader(const object::ObjectFile *O); 67 void printMachOLoadCommands(const object::ObjectFile *O); 68 69 void printExportsTrie(const object::ObjectFile *O); 70 void printRebaseTable(object::ObjectFile *O); 71 void printBindTable(object::ObjectFile *O); 72 void printLazyBindTable(object::ObjectFile *O); 73 void printWeakBindTable(object::ObjectFile *O); 74 75 } // namespace objdump 76 } // namespace llvm 77 78 #endif 79