#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/bit.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/BinaryFormat/Swift.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/MachO.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/SymbolicFile.h"
#include "llvm/Support/DataExtractor.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <limits>
#include <list>
#include <memory>
#include <system_error>
usingnamespacellvm;
usingnamespaceobject;
namespace {
struct section_base { … };
}
static Error malformedError(const Twine &Msg) { … }
template <typename T>
static T getStruct(const MachOObjectFile &O, const char *P) { … }
template <typename T>
static Expected<T> getStructOrErr(const MachOObjectFile &O, const char *P) { … }
static const char *
getSectionPtr(const MachOObjectFile &O, MachOObjectFile::LoadCommandInfo L,
unsigned Sec) { … }
static const char *getPtr(const MachOObjectFile &O, size_t Offset,
size_t MachOFilesetEntryOffset = 0) { … }
static MachO::nlist_base
getSymbolTableEntryBase(const MachOObjectFile &O, DataRefImpl DRI) { … }
static StringRef parseSegmentOrSectionName(const char *P) { … }
static unsigned getCPUType(const MachOObjectFile &O) { … }
static unsigned getCPUSubType(const MachOObjectFile &O) { … }
static uint32_t
getPlainRelocationAddress(const MachO::any_relocation_info &RE) { … }
static unsigned
getScatteredRelocationAddress(const MachO::any_relocation_info &RE) { … }
static bool getPlainRelocationPCRel(const MachOObjectFile &O,
const MachO::any_relocation_info &RE) { … }
static bool
getScatteredRelocationPCRel(const MachO::any_relocation_info &RE) { … }
static unsigned getPlainRelocationLength(const MachOObjectFile &O,
const MachO::any_relocation_info &RE) { … }
static unsigned
getScatteredRelocationLength(const MachO::any_relocation_info &RE) { … }
static unsigned getPlainRelocationType(const MachOObjectFile &O,
const MachO::any_relocation_info &RE) { … }
static uint32_t getSectionFlags(const MachOObjectFile &O,
DataRefImpl Sec) { … }
static Expected<MachOObjectFile::LoadCommandInfo>
getLoadCommandInfo(const MachOObjectFile &Obj, const char *Ptr,
uint32_t LoadCommandIndex) { … }
static Expected<MachOObjectFile::LoadCommandInfo>
getFirstLoadCommandInfo(const MachOObjectFile &Obj) { … }
static Expected<MachOObjectFile::LoadCommandInfo>
getNextLoadCommandInfo(const MachOObjectFile &Obj, uint32_t LoadCommandIndex,
const MachOObjectFile::LoadCommandInfo &L) { … }
template <typename T>
static void parseHeader(const MachOObjectFile &Obj, T &Header,
Error &Err) { … }
struct MachOElement { … };
static Error checkOverlappingElement(std::list<MachOElement> &Elements,
uint64_t Offset, uint64_t Size,
const char *Name) { … }
template <typename Segment, typename Section>
static Error parseSegmentLoadCommand(
const MachOObjectFile &Obj, const MachOObjectFile::LoadCommandInfo &Load,
SmallVectorImpl<const char *> &Sections, bool &IsPageZeroSegment,
uint32_t LoadCommandIndex, const char *CmdName, uint64_t SizeOfHeaders,
std::list<MachOElement> &Elements) { … }
static Error checkSymtabCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
const char **SymtabLoadCmd,
std::list<MachOElement> &Elements) { … }
static Error checkDysymtabCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
const char **DysymtabLoadCmd,
std::list<MachOElement> &Elements) { … }
static Error checkLinkeditDataCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
const char **LoadCmd, const char *CmdName,
std::list<MachOElement> &Elements,
const char *ElementName) { … }
static Error checkDyldInfoCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
const char **LoadCmd, const char *CmdName,
std::list<MachOElement> &Elements) { … }
static Error checkDylibCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex, const char *CmdName) { … }
static Error checkDylibIdCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
const char **LoadCmd) { … }
static Error checkDyldCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex, const char *CmdName) { … }
static Error checkVersCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
const char **LoadCmd, const char *CmdName) { … }
static Error checkNoteCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
std::list<MachOElement> &Elements) { … }
static Error
parseBuildVersionCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
SmallVectorImpl<const char*> &BuildTools,
uint32_t LoadCommandIndex) { … }
static Error checkRpathCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex) { … }
static Error checkEncryptCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
uint64_t cryptoff, uint64_t cryptsize,
const char **LoadCmd, const char *CmdName) { … }
static Error checkLinkerOptCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex) { … }
static Error checkSubCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex, const char *CmdName,
size_t SizeOfCmd, const char *CmdStructName,
uint32_t PathOffset, const char *PathFieldName) { … }
static Error checkThreadCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo &Load,
uint32_t LoadCommandIndex,
const char *CmdName) { … }
static Error checkTwoLevelHintsCommand(const MachOObjectFile &Obj,
const MachOObjectFile::LoadCommandInfo
&Load,
uint32_t LoadCommandIndex,
const char **LoadCmd,
std::list<MachOElement> &Elements) { … }
static bool isLoadCommandObsolete(uint32_t cmd) { … }
Expected<std::unique_ptr<MachOObjectFile>>
MachOObjectFile::create(MemoryBufferRef Object, bool IsLittleEndian,
bool Is64Bits, uint32_t UniversalCputype,
uint32_t UniversalIndex,
size_t MachOFilesetEntryOffset) { … }
MachOObjectFile::MachOObjectFile(MemoryBufferRef Object, bool IsLittleEndian,
bool Is64bits, Error &Err,
uint32_t UniversalCputype,
uint32_t UniversalIndex,
size_t MachOFilesetEntryOffset)
: … { … }
Error MachOObjectFile::checkSymbolTable() const { … }
void MachOObjectFile::moveSymbolNext(DataRefImpl &Symb) const { … }
Expected<StringRef> MachOObjectFile::getSymbolName(DataRefImpl Symb) const { … }
unsigned MachOObjectFile::getSectionType(SectionRef Sec) const { … }
uint64_t MachOObjectFile::getNValue(DataRefImpl Sym) const { … }
std::error_code MachOObjectFile::getIndirectName(DataRefImpl Symb,
StringRef &Res) const { … }
uint64_t MachOObjectFile::getSymbolValueImpl(DataRefImpl Sym) const { … }
Expected<uint64_t> MachOObjectFile::getSymbolAddress(DataRefImpl Sym) const { … }
uint32_t MachOObjectFile::getSymbolAlignment(DataRefImpl DRI) const { … }
uint64_t MachOObjectFile::getCommonSymbolSizeImpl(DataRefImpl DRI) const { … }
Expected<SymbolRef::Type>
MachOObjectFile::getSymbolType(DataRefImpl Symb) const { … }
Expected<uint32_t> MachOObjectFile::getSymbolFlags(DataRefImpl DRI) const { … }
Expected<section_iterator>
MachOObjectFile::getSymbolSection(DataRefImpl Symb) const { … }
unsigned MachOObjectFile::getSymbolSectionID(SymbolRef Sym) const { … }
void MachOObjectFile::moveSectionNext(DataRefImpl &Sec) const { … }
Expected<StringRef> MachOObjectFile::getSectionName(DataRefImpl Sec) const { … }
uint64_t MachOObjectFile::getSectionAddress(DataRefImpl Sec) const { … }
uint64_t MachOObjectFile::getSectionIndex(DataRefImpl Sec) const { … }
uint64_t MachOObjectFile::getSectionSize(DataRefImpl Sec) const { … }
ArrayRef<uint8_t> MachOObjectFile::getSectionContents(uint32_t Offset,
uint64_t Size) const { … }
Expected<ArrayRef<uint8_t>>
MachOObjectFile::getSectionContents(DataRefImpl Sec) const { … }
uint64_t MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const { … }
Expected<SectionRef> MachOObjectFile::getSection(unsigned SectionIndex) const { … }
Expected<SectionRef> MachOObjectFile::getSection(StringRef SectionName) const { … }
bool MachOObjectFile::isSectionCompressed(DataRefImpl Sec) const { … }
bool MachOObjectFile::isSectionText(DataRefImpl Sec) const { … }
bool MachOObjectFile::isSectionData(DataRefImpl Sec) const { … }
bool MachOObjectFile::isSectionBSS(DataRefImpl Sec) const { … }
bool MachOObjectFile::isDebugSection(DataRefImpl Sec) const { … }
namespace {
template <typename LoadCommandType>
ArrayRef<uint8_t> getSegmentContents(const MachOObjectFile &Obj,
MachOObjectFile::LoadCommandInfo LoadCmd,
StringRef SegmentName) { … }
template <typename LoadCommandType>
ArrayRef<uint8_t> getSegmentContents(const MachOObjectFile &Obj,
MachOObjectFile::LoadCommandInfo LoadCmd) { … }
}
ArrayRef<uint8_t>
MachOObjectFile::getSegmentContents(StringRef SegmentName) const { … }
ArrayRef<uint8_t>
MachOObjectFile::getSegmentContents(size_t SegmentIndex) const { … }
unsigned MachOObjectFile::getSectionID(SectionRef Sec) const { … }
bool MachOObjectFile::isSectionVirtual(DataRefImpl Sec) const { … }
bool MachOObjectFile::isSectionBitcode(DataRefImpl Sec) const { … }
bool MachOObjectFile::isSectionStripped(DataRefImpl Sec) const { … }
relocation_iterator MachOObjectFile::section_rel_begin(DataRefImpl Sec) const { … }
relocation_iterator
MachOObjectFile::section_rel_end(DataRefImpl Sec) const { … }
relocation_iterator MachOObjectFile::extrel_begin() const { … }
relocation_iterator MachOObjectFile::extrel_end() const { … }
relocation_iterator MachOObjectFile::locrel_begin() const { … }
relocation_iterator MachOObjectFile::locrel_end() const { … }
void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const { … }
uint64_t MachOObjectFile::getRelocationOffset(DataRefImpl Rel) const { … }
symbol_iterator
MachOObjectFile::getRelocationSymbol(DataRefImpl Rel) const { … }
section_iterator
MachOObjectFile::getRelocationSection(DataRefImpl Rel) const { … }
uint64_t MachOObjectFile::getRelocationType(DataRefImpl Rel) const { … }
void MachOObjectFile::getRelocationTypeName(
DataRefImpl Rel, SmallVectorImpl<char> &Result) const { … }
uint8_t MachOObjectFile::getRelocationLength(DataRefImpl Rel) const { … }
StringRef MachOObjectFile::guessLibraryShortName(StringRef Name,
bool &isFramework,
StringRef &Suffix) { … }
std::error_code MachOObjectFile::getLibraryShortNameByIndex(unsigned Index,
StringRef &Res) const { … }
uint32_t MachOObjectFile::getLibraryCount() const { … }
section_iterator
MachOObjectFile::getRelocationRelocatedSection(relocation_iterator Rel) const { … }
basic_symbol_iterator MachOObjectFile::symbol_begin() const { … }
basic_symbol_iterator MachOObjectFile::symbol_end() const { … }
symbol_iterator MachOObjectFile::getSymbolByIndex(unsigned Index) const { … }
uint64_t MachOObjectFile::getSymbolIndex(DataRefImpl Symb) const { … }
section_iterator MachOObjectFile::section_begin() const { … }
section_iterator MachOObjectFile::section_end() const { … }
uint8_t MachOObjectFile::getBytesInAddress() const { … }
StringRef MachOObjectFile::getFileFormatName() const { … }
Triple::ArchType MachOObjectFile::getArch(uint32_t CPUType, uint32_t CPUSubType) { … }
Triple MachOObjectFile::getArchTriple(uint32_t CPUType, uint32_t CPUSubType,
const char **McpuDefault,
const char **ArchFlag) { … }
Triple MachOObjectFile::getHostArch() { … }
bool MachOObjectFile::isValidArch(StringRef ArchFlag) { … }
ArrayRef<StringRef> MachOObjectFile::getValidArchs() { … }
Triple::ArchType MachOObjectFile::getArch() const { … }
Triple MachOObjectFile::getArchTriple(const char **McpuDefault) const { … }
relocation_iterator MachOObjectFile::section_rel_begin(unsigned Index) const { … }
relocation_iterator MachOObjectFile::section_rel_end(unsigned Index) const { … }
dice_iterator MachOObjectFile::begin_dices() const { … }
dice_iterator MachOObjectFile::end_dices() const { … }
ExportEntry::ExportEntry(Error *E, const MachOObjectFile *O,
ArrayRef<uint8_t> T) : … { … }
void ExportEntry::moveToFirst() { … }
void ExportEntry::moveToEnd() { … }
bool ExportEntry::operator==(const ExportEntry &Other) const { … }
uint64_t ExportEntry::readULEB128(const uint8_t *&Ptr, const char **error) { … }
StringRef ExportEntry::name() const { … }
uint64_t ExportEntry::flags() const { … }
uint64_t ExportEntry::address() const { … }
uint64_t ExportEntry::other() const { … }
StringRef ExportEntry::otherName() const { … }
uint32_t ExportEntry::nodeOffset() const { … }
ExportEntry::NodeState::NodeState(const uint8_t *Ptr)
: … { … }
void ExportEntry::pushNode(uint64_t offset) { … }
void ExportEntry::pushDownUntilBottom() { … }
void ExportEntry::moveNext() { … }
iterator_range<export_iterator>
MachOObjectFile::exports(Error &E, ArrayRef<uint8_t> Trie,
const MachOObjectFile *O) { … }
iterator_range<export_iterator> MachOObjectFile::exports(Error &Err) const { … }
MachOAbstractFixupEntry::MachOAbstractFixupEntry(Error *E,
const MachOObjectFile *O)
: … { … }
int32_t MachOAbstractFixupEntry::segmentIndex() const { … }
uint64_t MachOAbstractFixupEntry::segmentOffset() const { … }
uint64_t MachOAbstractFixupEntry::segmentAddress() const { … }
StringRef MachOAbstractFixupEntry::segmentName() const { … }
StringRef MachOAbstractFixupEntry::sectionName() const { … }
uint64_t MachOAbstractFixupEntry::address() const { … }
StringRef MachOAbstractFixupEntry::symbolName() const { … }
int64_t MachOAbstractFixupEntry::addend() const { … }
uint32_t MachOAbstractFixupEntry::flags() const { … }
int MachOAbstractFixupEntry::ordinal() const { … }
StringRef MachOAbstractFixupEntry::typeName() const { … }
void MachOAbstractFixupEntry::moveToFirst() { … }
void MachOAbstractFixupEntry::moveToEnd() { … }
void MachOAbstractFixupEntry::moveNext() { … }
MachOChainedFixupEntry::MachOChainedFixupEntry(Error *E,
const MachOObjectFile *O,
bool Parse)
: … { … }
void MachOChainedFixupEntry::findNextPageWithFixups() { … }
void MachOChainedFixupEntry::moveToFirst() { … }
void MachOChainedFixupEntry::moveToEnd() { … }
void MachOChainedFixupEntry::moveNext() { … }
bool MachOChainedFixupEntry::operator==(
const MachOChainedFixupEntry &Other) const { … }
MachORebaseEntry::MachORebaseEntry(Error *E, const MachOObjectFile *O,
ArrayRef<uint8_t> Bytes, bool is64Bit)
: … { … }
void MachORebaseEntry::moveToFirst() { … }
void MachORebaseEntry::moveToEnd() { … }
void MachORebaseEntry::moveNext() { … }
uint64_t MachORebaseEntry::readULEB128(const char **error) { … }
int32_t MachORebaseEntry::segmentIndex() const { … }
uint64_t MachORebaseEntry::segmentOffset() const { … }
StringRef MachORebaseEntry::typeName() const { … }
StringRef MachORebaseEntry::segmentName() const { … }
StringRef MachORebaseEntry::sectionName() const { … }
uint64_t MachORebaseEntry::address() const { … }
bool MachORebaseEntry::operator==(const MachORebaseEntry &Other) const { … }
iterator_range<rebase_iterator>
MachOObjectFile::rebaseTable(Error &Err, MachOObjectFile *O,
ArrayRef<uint8_t> Opcodes, bool is64) { … }
iterator_range<rebase_iterator> MachOObjectFile::rebaseTable(Error &Err) { … }
MachOBindEntry::MachOBindEntry(Error *E, const MachOObjectFile *O,
ArrayRef<uint8_t> Bytes, bool is64Bit, Kind BK)
: … { … }
void MachOBindEntry::moveToFirst() { … }
void MachOBindEntry::moveToEnd() { … }
void MachOBindEntry::moveNext() { … }
uint64_t MachOBindEntry::readULEB128(const char **error) { … }
int64_t MachOBindEntry::readSLEB128(const char **error) { … }
int32_t MachOBindEntry::segmentIndex() const { … }
uint64_t MachOBindEntry::segmentOffset() const { … }
StringRef MachOBindEntry::typeName() const { … }
StringRef MachOBindEntry::symbolName() const { … }
int64_t MachOBindEntry::addend() const { … }
uint32_t MachOBindEntry::flags() const { … }
int MachOBindEntry::ordinal() const { … }
StringRef MachOBindEntry::segmentName() const { … }
StringRef MachOBindEntry::sectionName() const { … }
uint64_t MachOBindEntry::address() const { … }
bool MachOBindEntry::operator==(const MachOBindEntry &Other) const { … }
BindRebaseSegInfo::BindRebaseSegInfo(const object::MachOObjectFile *Obj) { … }
const char *BindRebaseSegInfo::checkSegAndOffsets(int32_t SegIndex,
uint64_t SegOffset,
uint8_t PointerSize,
uint64_t Count,
uint64_t Skip) { … }
StringRef BindRebaseSegInfo::segmentName(int32_t SegIndex) { … }
const BindRebaseSegInfo::SectionInfo &BindRebaseSegInfo::findSection(
int32_t SegIndex, uint64_t SegOffset) { … }
StringRef BindRebaseSegInfo::sectionName(int32_t SegIndex,
uint64_t SegOffset) { … }
uint64_t BindRebaseSegInfo::address(uint32_t SegIndex, uint64_t OffsetInSeg) { … }
iterator_range<bind_iterator>
MachOObjectFile::bindTable(Error &Err, MachOObjectFile *O,
ArrayRef<uint8_t> Opcodes, bool is64,
MachOBindEntry::Kind BKind) { … }
iterator_range<bind_iterator> MachOObjectFile::bindTable(Error &Err) { … }
iterator_range<bind_iterator> MachOObjectFile::lazyBindTable(Error &Err) { … }
iterator_range<bind_iterator> MachOObjectFile::weakBindTable(Error &Err) { … }
iterator_range<fixup_iterator> MachOObjectFile::fixupTable(Error &Err) { … }
MachOObjectFile::load_command_iterator
MachOObjectFile::begin_load_commands() const { … }
MachOObjectFile::load_command_iterator
MachOObjectFile::end_load_commands() const { … }
iterator_range<MachOObjectFile::load_command_iterator>
MachOObjectFile::load_commands() const { … }
StringRef
MachOObjectFile::getSectionFinalSegmentName(DataRefImpl Sec) const { … }
ArrayRef<char>
MachOObjectFile::getSectionRawName(DataRefImpl Sec) const { … }
ArrayRef<char>
MachOObjectFile::getSectionRawFinalSegmentName(DataRefImpl Sec) const { … }
bool
MachOObjectFile::isRelocationScattered(const MachO::any_relocation_info &RE)
const { … }
unsigned MachOObjectFile::getPlainRelocationSymbolNum(
const MachO::any_relocation_info &RE) const { … }
bool MachOObjectFile::getPlainRelocationExternal(
const MachO::any_relocation_info &RE) const { … }
bool MachOObjectFile::getScatteredRelocationScattered(
const MachO::any_relocation_info &RE) const { … }
uint32_t MachOObjectFile::getScatteredRelocationValue(
const MachO::any_relocation_info &RE) const { … }
uint32_t MachOObjectFile::getScatteredRelocationType(
const MachO::any_relocation_info &RE) const { … }
unsigned MachOObjectFile::getAnyRelocationAddress(
const MachO::any_relocation_info &RE) const { … }
unsigned MachOObjectFile::getAnyRelocationPCRel(
const MachO::any_relocation_info &RE) const { … }
unsigned MachOObjectFile::getAnyRelocationLength(
const MachO::any_relocation_info &RE) const { … }
unsigned
MachOObjectFile::getAnyRelocationType(
const MachO::any_relocation_info &RE) const { … }
SectionRef
MachOObjectFile::getAnyRelocationSection(
const MachO::any_relocation_info &RE) const { … }
MachO::section MachOObjectFile::getSection(DataRefImpl DRI) const { … }
MachO::section_64 MachOObjectFile::getSection64(DataRefImpl DRI) const { … }
MachO::section MachOObjectFile::getSection(const LoadCommandInfo &L,
unsigned Index) const { … }
MachO::section_64 MachOObjectFile::getSection64(const LoadCommandInfo &L,
unsigned Index) const { … }
MachO::nlist
MachOObjectFile::getSymbolTableEntry(DataRefImpl DRI) const { … }
MachO::nlist_64
MachOObjectFile::getSymbol64TableEntry(DataRefImpl DRI) const { … }
MachO::linkedit_data_command
MachOObjectFile::getLinkeditDataLoadCommand(const LoadCommandInfo &L) const { … }
MachO::segment_command
MachOObjectFile::getSegmentLoadCommand(const LoadCommandInfo &L) const { … }
MachO::segment_command_64
MachOObjectFile::getSegment64LoadCommand(const LoadCommandInfo &L) const { … }
MachO::linker_option_command
MachOObjectFile::getLinkerOptionLoadCommand(const LoadCommandInfo &L) const { … }
MachO::version_min_command
MachOObjectFile::getVersionMinLoadCommand(const LoadCommandInfo &L) const { … }
MachO::note_command
MachOObjectFile::getNoteLoadCommand(const LoadCommandInfo &L) const { … }
MachO::build_version_command
MachOObjectFile::getBuildVersionLoadCommand(const LoadCommandInfo &L) const { … }
MachO::build_tool_version
MachOObjectFile::getBuildToolVersion(unsigned index) const { … }
MachO::dylib_command
MachOObjectFile::getDylibIDLoadCommand(const LoadCommandInfo &L) const { … }
MachO::dyld_info_command
MachOObjectFile::getDyldInfoLoadCommand(const LoadCommandInfo &L) const { … }
MachO::dylinker_command
MachOObjectFile::getDylinkerCommand(const LoadCommandInfo &L) const { … }
MachO::uuid_command
MachOObjectFile::getUuidCommand(const LoadCommandInfo &L) const { … }
MachO::rpath_command
MachOObjectFile::getRpathCommand(const LoadCommandInfo &L) const { … }
MachO::source_version_command
MachOObjectFile::getSourceVersionCommand(const LoadCommandInfo &L) const { … }
MachO::entry_point_command
MachOObjectFile::getEntryPointCommand(const LoadCommandInfo &L) const { … }
MachO::encryption_info_command
MachOObjectFile::getEncryptionInfoCommand(const LoadCommandInfo &L) const { … }
MachO::encryption_info_command_64
MachOObjectFile::getEncryptionInfoCommand64(const LoadCommandInfo &L) const { … }
MachO::sub_framework_command
MachOObjectFile::getSubFrameworkCommand(const LoadCommandInfo &L) const { … }
MachO::sub_umbrella_command
MachOObjectFile::getSubUmbrellaCommand(const LoadCommandInfo &L) const { … }
MachO::sub_library_command
MachOObjectFile::getSubLibraryCommand(const LoadCommandInfo &L) const { … }
MachO::sub_client_command
MachOObjectFile::getSubClientCommand(const LoadCommandInfo &L) const { … }
MachO::routines_command
MachOObjectFile::getRoutinesCommand(const LoadCommandInfo &L) const { … }
MachO::routines_command_64
MachOObjectFile::getRoutinesCommand64(const LoadCommandInfo &L) const { … }
MachO::thread_command
MachOObjectFile::getThreadCommand(const LoadCommandInfo &L) const { … }
MachO::fileset_entry_command
MachOObjectFile::getFilesetEntryLoadCommand(const LoadCommandInfo &L) const { … }
MachO::any_relocation_info
MachOObjectFile::getRelocation(DataRefImpl Rel) const { … }
MachO::data_in_code_entry
MachOObjectFile::getDice(DataRefImpl Rel) const { … }
const MachO::mach_header &MachOObjectFile::getHeader() const { … }
const MachO::mach_header_64 &MachOObjectFile::getHeader64() const { … }
uint32_t MachOObjectFile::getIndirectSymbolTableEntry(
const MachO::dysymtab_command &DLC,
unsigned Index) const { … }
MachO::data_in_code_entry
MachOObjectFile::getDataInCodeTableEntry(uint32_t DataOffset,
unsigned Index) const { … }
MachO::symtab_command MachOObjectFile::getSymtabLoadCommand() const { … }
MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand() const { … }
MachO::linkedit_data_command
MachOObjectFile::getDataInCodeLoadCommand() const { … }
MachO::linkedit_data_command
MachOObjectFile::getLinkOptHintsLoadCommand() const { … }
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoRebaseOpcodes() const { … }
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const { … }
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const { … }
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const { … }
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoExportsTrie() const { … }
Expected<std::optional<MachO::linkedit_data_command>>
MachOObjectFile::getChainedFixupsLoadCommand() const { … }
Expected<std::optional<MachO::dyld_chained_fixups_header>>
MachOObjectFile::getChainedFixupsHeader() const { … }
Expected<std::pair<size_t, std::vector<ChainedFixupsSegment>>>
MachOObjectFile::getChainedFixupsSegments() const { … }
template <typename T> static int getEncodedOrdinal(T Value) { … }
template <typename T, unsigned N>
static std::array<T, N> getArray(const MachOObjectFile &O, const void *Ptr) { … }
Expected<std::vector<ChainedFixupTarget>>
MachOObjectFile::getDyldChainedFixupTargets() const { … }
ArrayRef<uint8_t> MachOObjectFile::getDyldExportsTrie() const { … }
SmallVector<uint64_t> MachOObjectFile::getFunctionStarts() const { … }
ArrayRef<uint8_t> MachOObjectFile::getUuid() const { … }
StringRef MachOObjectFile::getStringTableData() const { … }
bool MachOObjectFile::is64Bit() const { … }
void MachOObjectFile::ReadULEB128s(uint64_t Index,
SmallVectorImpl<uint64_t> &Out) const { … }
bool MachOObjectFile::isRelocatableObject() const { … }
Expected<std::unique_ptr<MachOObjectFile>> ObjectFile::createMachOObjectFile(
MemoryBufferRef Buffer, uint32_t UniversalCputype, uint32_t UniversalIndex,
size_t MachOFilesetEntryOffset) { … }
StringRef MachOObjectFile::mapDebugSectionName(StringRef Name) const { … }
Expected<std::vector<std::string>>
MachOObjectFile::findDsymObjectMembers(StringRef Path) { … }
llvm::binaryformat::Swift5ReflectionSectionKind
MachOObjectFile::mapReflectionSectionNameToEnumValue(
StringRef SectionName) const { … }
bool MachOObjectFile::isMachOPairedReloc(uint64_t RelocType, uint64_t Arch) { … }