1 //===-- MachODump.h ---------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVM_OBJDUMP_MACHODUMP_H
10 #define LLVM_TOOLS_LLVM_OBJDUMP_MACHODUMP_H
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/Support/CommandLine.h"
22 class MachOObjectFile
;
23 class MachOUniversalBinary
;
35 void parseMachOOptions(const llvm::opt::InputArgList
&InputArgs
);
37 enum class FunctionStartsMode
{ Addrs
, Names
, Both
, None
};
39 // MachO specific options
41 extern bool DataInCode
;
42 extern std::string DisSymName
;
43 extern bool ChainedFixups
;
46 extern bool DylibsUsed
;
47 extern bool ExportsTrie
;
48 extern bool FirstPrivateHeader
;
49 extern bool FullLeadingAddr
;
50 extern FunctionStartsMode FunctionStartsType
;
51 extern bool IndirectSymbols
;
52 extern bool InfoPlist
;
54 extern bool LeadingHeaders
;
55 extern bool LinkOptHints
;
56 extern bool ObjcMetaData
;
59 extern bool SymbolicOperands
;
60 extern bool UniversalHeaders
;
64 Error
getMachORelocationValueString(const object::MachOObjectFile
*Obj
,
65 const object::RelocationRef
&RelRef
,
66 llvm::SmallVectorImpl
<char> &Result
);
68 const object::MachOObjectFile
*
69 getMachODSymObject(const object::MachOObjectFile
*O
, StringRef Filename
,
70 std::unique_ptr
<object::Binary
> &DSYMBinary
,
71 std::unique_ptr
<MemoryBuffer
> &DSYMBuf
);
73 void parseInputMachO(StringRef Filename
);
74 void parseInputMachO(object::MachOUniversalBinary
*UB
);
76 void printMachOUnwindInfo(const object::MachOObjectFile
*O
);
77 void printMachOFileHeader(const object::ObjectFile
*O
);
78 void printMachOLoadCommands(const object::ObjectFile
*O
);
80 void printExportsTrie(const object::ObjectFile
*O
);
81 void printRebaseTable(object::ObjectFile
*O
);
82 void printBindTable(object::ObjectFile
*O
);
83 void printLazyBindTable(object::ObjectFile
*O
);
84 void printWeakBindTable(object::ObjectFile
*O
);
86 } // namespace objdump