LLVM API Documentation
#include <MachO.h>
Definition at line 187 of file Object/MachO.h.
MachOObjectFile::MachOObjectFile | ( | MemoryBufferRef | Object, |
bool | IsLittleEndian, | ||
bool | Is64Bits, | ||
std::error_code & | EC | ||
) |
Definition at line 239 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::C, llvm::MachO::load_command::cmd, getFirstLoadCommandInfo(), getHeader(), getNextLoadCommandInfo(), getSectionPtr(), getSegmentLoadCommandNumSections(), I, is64Bit(), isPageZeroSegment(), llvm::MachO::LC_DATA_IN_CODE, llvm::MachO::LC_DYLD_INFO, llvm::MachO::LC_DYLD_INFO_ONLY, llvm::MachO::LC_DYSYMTAB, llvm::MachO::LC_LAZY_LOAD_DYLIB, llvm::MachO::LC_LOAD_DYLIB, llvm::MachO::LC_LOAD_UPWARD_DYLIB, llvm::MachO::LC_LOAD_WEAK_DYLIB, llvm::MachO::LC_REEXPORT_DYLIB, llvm::MachO::LC_SEGMENT, llvm::MachO::LC_SEGMENT_64, llvm::MachO::LC_SYMTAB, llvm::SPII::Load, llvm::MachO::mach_header::ncmds, llvm::object::MachOObjectFile::LoadCommandInfo::Ptr, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
dice_iterator MachOObjectFile::begin_dices | ( | ) | const |
Definition at line 1503 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, getDataInCodeLoadCommand(), getPtr(), and llvm::object::DataRefImpl::p.
For use iterating over all bind table entries.
Referenced by lazyBindTable(), and weakBindTable().
static iterator_range<bind_iterator> llvm::object::MachOObjectFile::bindTable | ( | ArrayRef< uint8_t > | Opcodes, |
bool | is64, | ||
MachOBindEntry::Kind | |||
) | [static] |
For use examining bind opcodes not in a MachOObjectFile.
static bool llvm::object::MachOObjectFile::classof | ( | const Binary * | v | ) | [inline, static] |
Reimplemented from llvm::object::ObjectFile.
Definition at line 410 of file Object/MachO.h.
References llvm::object::Binary::isMachO().
dice_iterator MachOObjectFile::end_dices | ( | ) | const |
Definition at line 1513 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, getDataInCodeLoadCommand(), getPtr(), and llvm::object::DataRefImpl::p.
For use iterating over all exported symbols.
iterator_range< export_iterator > MachOObjectFile::exports | ( | ArrayRef< uint8_t > | Trie | ) | [static] |
For use examining a trie not in a MachOObjectFile.
Definition at line 1685 of file MachOObjectFile.cpp.
Definition at line 2190 of file MachOObjectFile.cpp.
References getPlainRelocationAddress(), getScatteredRelocationAddress(), and isRelocationScattered().
Referenced by getRelocationOffset().
Definition at line 2204 of file MachOObjectFile.cpp.
References getPlainRelocationLength(), getScatteredRelocationLength(), and isRelocationScattered().
Referenced by llvm::RuntimeDyldMachO::getRelocationEntry(), getRelocationValueString(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
Definition at line 2197 of file MachOObjectFile.cpp.
References getPlainRelocationPCRel(), getScatteredRelocationPCRel(), and isRelocationScattered().
Referenced by llvm::RuntimeDyldMachO::getRelocationEntry(), getRelocationValueString(), llvm::RuntimeDyldMachO::makeValueAddendPCRel(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
Definition at line 2212 of file MachOObjectFile.cpp.
References getPlainRelocationType(), getScatteredRelocationType(), and isRelocationScattered().
Referenced by llvm::RuntimeDyldMachO::getRelocationEntry(), getRelocationType(), getRelocationValueString(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
unsigned llvm::object::MachOObjectFile::getArch | ( | ) | const [override, virtual] |
Triple llvm::object::MachOObjectFile::getArch | ( | const char ** | McpuDefault, |
Triple * | ThumbTriple | ||
) | const |
Triple::ArchType MachOObjectFile::getArch | ( | uint32_t | CPUType | ) | [static] |
Definition at line 1295 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::Triple::arm, llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_TYPE_I386, llvm::MachO::CPU_TYPE_POWERPC, llvm::MachO::CPU_TYPE_POWERPC64, llvm::MachO::CPU_TYPE_X86_64, llvm::Triple::ppc, llvm::Triple::ppc64, llvm::Triple::UnknownArch, llvm::Triple::x86, and llvm::Triple::x86_64.
static Triple llvm::object::MachOObjectFile::getArch | ( | uint32_t | CPUType, |
uint32_t | CPUSubType, | ||
const char ** | McpuDefault = nullptr |
||
) | [static] |
Triple MachOObjectFile::getArch | ( | uint32_t | CPUType, |
uint32_t | CPUSubType, | ||
const char ** | McpuDefault, | ||
Triple * | ThumbTriple | ||
) | [static] |
Definition at line 1435 of file MachOObjectFile.cpp.
References getArch(), getThumbArch(), and T.
uint8_t MachOObjectFile::getBytesInAddress | ( | ) | const [override, virtual] |
The number of bytes used to represent an address in this object file format.
Implements llvm::object::ObjectFile.
Definition at line 1257 of file MachOObjectFile.cpp.
References is64Bit().
Definition at line 2393 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::cmd, and llvm::MachO::LC_DATA_IN_CODE.
Referenced by begin_dices(), and end_dices().
MachO::data_in_code_entry MachOObjectFile::getDataInCodeTableEntry | ( | uint32_t | DataOffset, |
unsigned | Index | ||
) | const |
Definition at line 2378 of file MachOObjectFile.cpp.
References getPtr().
MachO::data_in_code_entry MachOObjectFile::getDice | ( | DataRefImpl | Rel | ) | const |
Definition at line 2357 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::p, and P.
Referenced by llvm::object::DiceRef::getKind(), llvm::object::DiceRef::getLength(), and llvm::object::DiceRef::getOffset().
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoBindOpcodes | ( | ) | const |
Definition at line 2417 of file MachOObjectFile.cpp.
References getPtr().
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoExportsTrie | ( | ) | const |
Definition at line 2450 of file MachOObjectFile.cpp.
References getPtr().
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoLazyBindOpcodes | ( | ) | const |
Definition at line 2439 of file MachOObjectFile.cpp.
References getPtr().
Referenced by lazyBindTable().
Definition at line 2312 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoRebaseOpcodes | ( | ) | const |
Definition at line 2406 of file MachOObjectFile.cpp.
References getPtr().
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoWeakBindOpcodes | ( | ) | const |
Definition at line 2428 of file MachOObjectFile.cpp.
References getPtr().
Referenced by weakBindTable().
Definition at line 2307 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
Definition at line 2317 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
Definition at line 2388 of file MachOObjectFile.cpp.
Referenced by llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
Definition at line 2332 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
StringRef MachOObjectFile::getFileFormatName | ( | ) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 1261 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_ARCH_ABI64, llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_TYPE_I386, llvm::MachO::CPU_TYPE_POWERPC, llvm::MachO::CPU_TYPE_POWERPC64, llvm::MachO::CPU_TYPE_X86_64, getCPUType(), and is64Bit().
Definition at line 2231 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::C, getPtr(), is64Bit(), llvm::SPII::Load, and llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
Referenced by MachOObjectFile().
MachO::mach_header MachOObjectFile::getHeader | ( | ) | const |
Definition at line 2362 of file MachOObjectFile.cpp.
References getPtr().
Referenced by getCPUType(), getRelocationOffset(), isRelocatableObject(), and MachOObjectFile().
Definition at line 2366 of file MachOObjectFile.cpp.
References getPtr().
Triple MachOObjectFile::getHostArch | ( | ) | [static] |
Definition at line 1444 of file MachOObjectFile.cpp.
References llvm::sys::getDefaultTargetTriple().
std::error_code MachOObjectFile::getIndirectName | ( | DataRefImpl | Symb, |
StringRef & | Res | ||
) | const |
Definition at line 305 of file MachOObjectFile.cpp.
References llvm::StringRef::data(), getStringTableData(), getSymbol64TableEntry(), getSymbolTableEntry(), is64Bit(), llvm::MachO::N_INDR, llvm::MachO::N_TYPE, llvm::MachO::nlist::n_type, llvm::MachO::nlist_64::n_type, llvm::MachO::nlist::n_value, llvm::MachO::nlist_64::n_value, llvm::object::parse_failed, llvm::StringRef::size(), and llvm::object::success.
uint32_t MachOObjectFile::getIndirectSymbolTableEntry | ( | const MachO::dysymtab_command & | DLC, |
unsigned | Index | ||
) | const |
Definition at line 2370 of file MachOObjectFile.cpp.
References getPtr(), and llvm::MachO::dysymtab_command::indirectsymoff.
Referenced by llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
std::error_code MachOObjectFile::getLibraryShortNameByIndex | ( | unsigned | Index, |
StringRef & | Res | ||
) | const |
Definition at line 1182 of file MachOObjectFile.cpp.
References llvm::MachO::dylib_command::cmdsize, llvm::MachO::dylib_command::dylib, llvm::StringRef::empty(), guessLibraryShortName(), llvm::MachO::dylib::name, Name, P, llvm::object::parse_failed, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::StringRef::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::object::success.
MachO::linkedit_data_command MachOObjectFile::getLinkeditDataLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 2282 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::linker_options_command MachOObjectFile::getLinkerOptionsLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 2297 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachOObjectFile::LoadCommandInfo MachOObjectFile::getNextLoadCommandInfo | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 2242 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::C, llvm::MachO::load_command::cmdsize, and llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
Referenced by MachOObjectFile().
Definition at line 2173 of file MachOObjectFile.cpp.
References llvm::object::Binary::isLittleEndian(), and llvm::MachO::any_relocation_info::r_word1.
Referenced by getRelocationSection(), getRelocationSymbol(), llvm::RuntimeDyldMachO::getRelocationValueRef(), printRelocationTargetName(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
unsigned MachOObjectFile::getPlainRelocationSymbolNum | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 2166 of file MachOObjectFile.cpp.
References llvm::object::Binary::isLittleEndian(), and llvm::MachO::any_relocation_info::r_word1.
Referenced by getRelocationSection(), getRelocationSymbol(), printRelocationTargetName(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
Definition at line 2338 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, getPtr(), getSection(), getSection64(), is64Bit(), P, llvm::MachO::section::reloff, and llvm::MachO::section_64::reloff.
Referenced by llvm::RuntimeDyldMachO::getRelocationEntry(), getRelocationOffset(), getRelocationSymbol(), getRelocationType(), llvm::RuntimeDyldMachO::getRelocationValueRef(), getRelocationValueString(), llvm::RuntimeDyldMachO::makeValueAddendPCRel(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
std::error_code MachOObjectFile::getRelocationAddress | ( | DataRefImpl | Rel, |
uint64_t & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 669 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getRelocationOffset(), getSectionAddress(), and llvm::object::success.
std::error_code MachOObjectFile::getRelocationHidden | ( | DataRefImpl | Rel, |
bool & | Result | ||
) | const [override, virtual] |
Reimplemented from llvm::object::ObjectFile.
Definition at line 1007 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::Triple::arm, llvm::object::DataRefImpl::d, llvm::MachO::GENERIC_RELOC_PAIR, getArch(), getRelocationType(), llvm::Triple::ppc, llvm::object::success, Type, llvm::Triple::x86, llvm::Triple::x86_64, llvm::MachO::X86_64_RELOC_SUBTRACTOR, and llvm::MachO::X86_64_RELOC_UNSIGNED.
std::error_code MachOObjectFile::getRelocationOffset | ( | DataRefImpl | Rel, |
uint64_t & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 682 of file MachOObjectFile.cpp.
References getAnyRelocationAddress(), getHeader(), getRelocation(), llvm::MachO::MH_OBJECT, and llvm::object::success.
Referenced by getRelocationAddress().
Definition at line 2220 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getPlainRelocationExternal(), getPlainRelocationSymbolNum(), isRelocationScattered(), section_end(), and llvm::object::ObjectFile::SectionRef.
Referenced by llvm::RuntimeDyldMachO::getRelocationValueRef().
symbol_iterator MachOObjectFile::getRelocationSymbol | ( | DataRefImpl | Rel | ) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 692 of file MachOObjectFile.cpp.
References getPlainRelocationExternal(), getPlainRelocationSymbolNum(), getPtr(), getRelocation(), getSymtabLoadCommand(), is64Bit(), isRelocationScattered(), llvm::object::DataRefImpl::p, llvm::object::SymbolicFile::symbol_end(), llvm::object::ObjectFile::SymbolRef, and llvm::MachO::symtab_command::symoff.
std::error_code MachOObjectFile::getRelocationType | ( | DataRefImpl | Rel, |
uint64_t & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 712 of file MachOObjectFile.cpp.
References getAnyRelocationType(), getRelocation(), and llvm::object::success.
Referenced by getRelocationHidden(), and getRelocationTypeName().
std::error_code MachOObjectFile::getRelocationTypeName | ( | DataRefImpl | Rel, |
SmallVectorImpl< char > & | Result | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 720 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::SmallVectorImpl< T >::append(), llvm::Triple::arm, llvm::array_lengthof(), llvm::StringRef::begin(), llvm::StringRef::end(), getArch(), getRelocationType(), llvm::Triple::ppc, llvm::object::success, llvm::Triple::UnknownArch, llvm::Triple::x86, and llvm::Triple::x86_64.
std::error_code MachOObjectFile::getRelocationValueString | ( | DataRefImpl | Rel, |
SmallVectorImpl< char > & | Result | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 832 of file MachOObjectFile.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::Triple::arm, llvm::MachO::ARM_RELOC_HALF, llvm::MachO::ARM_RELOC_HALF_SECTDIFF, llvm::MachO::ARM_RELOC_PAIR, llvm::raw_ostream::flush(), llvm::MachO::GENERIC_RELOC_LOCAL_SECTDIFF, llvm::MachO::GENERIC_RELOC_PAIR, llvm::MachO::GENERIC_RELOC_SECTDIFF, llvm::MachO::GENERIC_RELOC_TLV, getAnyRelocationLength(), getAnyRelocationPCRel(), getAnyRelocationType(), getArch(), getRelocation(), moveRelocationNext(), llvm::Triple::ppc, printRelocationTargetName(), llvm::report_fatal_error(), llvm::object::success, llvm::Triple::x86, llvm::Triple::x86_64, llvm::MachO::X86_64_RELOC_GOT, llvm::MachO::X86_64_RELOC_GOT_LOAD, llvm::MachO::X86_64_RELOC_SIGNED_1, llvm::MachO::X86_64_RELOC_SIGNED_2, llvm::MachO::X86_64_RELOC_SIGNED_4, llvm::MachO::X86_64_RELOC_SUBTRACTOR, llvm::MachO::X86_64_RELOC_TLV, and llvm::MachO::X86_64_RELOC_UNSIGNED.
bool MachOObjectFile::getScatteredRelocationScattered | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 2180 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word0.
uint32_t MachOObjectFile::getScatteredRelocationValue | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 2185 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word1.
MachO::section llvm::object::MachOObjectFile::getSection | ( | const LoadCommandInfo & | L, |
unsigned | Index | ||
) | const |
Referenced by getRelocation(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionFlags(), and getSectionSize().
MachO::section_64 llvm::object::MachOObjectFile::getSection64 | ( | const LoadCommandInfo & | L, |
unsigned | Index | ||
) | const |
std::error_code MachOObjectFile::getSectionAddress | ( | DataRefImpl | Sec, |
uint64_t & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 498 of file MachOObjectFile.cpp.
References llvm::MachO::section::addr, llvm::MachO::section_64::addr, getSection(), getSection64(), is64Bit(), and llvm::object::success.
Referenced by getRelocationAddress(), getSymbolSize(), and sectionContainsSymbol().
std::error_code MachOObjectFile::getSectionAlignment | ( | DataRefImpl | Sec, |
uint64_t & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 542 of file MachOObjectFile.cpp.
References Align(), llvm::MachO::section::align, llvm::MachO::section_64::align, getSection(), getSection64(), is64Bit(), and llvm::object::success.
std::error_code MachOObjectFile::getSectionContents | ( | DataRefImpl | Sec, |
StringRef & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 523 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), getSection(), getSection64(), is64Bit(), llvm::MachO::section::offset, llvm::MachO::section_64::offset, llvm::MachO::section::size, llvm::MachO::section_64::size, llvm::StringRef::substr(), and llvm::object::success.
Definition at line 2139 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), getSectionRawFinalSegmentName(), and parseSegmentOrSectionName().
std::error_code MachOObjectFile::getSectionName | ( | DataRefImpl | Sec, |
StringRef & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 491 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), getSectionRawName(), parseSegmentOrSectionName(), and llvm::object::success.
ArrayRef< char > MachOObjectFile::getSectionRawFinalSegmentName | ( | DataRefImpl | Sec | ) | const |
Definition at line 2152 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and llvm::makeArrayRef().
Referenced by getSectionFinalSegmentName().
ArrayRef< char > MachOObjectFile::getSectionRawName | ( | DataRefImpl | Sec | ) | const |
Definition at line 2145 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and llvm::makeArrayRef().
Referenced by getSectionName().
std::error_code MachOObjectFile::getSectionSize | ( | DataRefImpl | Sec, |
uint64_t & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 510 of file MachOObjectFile.cpp.
References getSection(), getSection64(), is64Bit(), llvm::MachO::section::size, llvm::MachO::section_64::size, and llvm::object::success.
Referenced by getSymbolSize(), and sectionContainsSymbol().
MachO::segment_command_64 MachOObjectFile::getSegment64LoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 2292 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
Referenced by getSegmentLoadCommandNumSections(), and isPageZeroSegment().
Definition at line 2287 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
Referenced by getSegmentLoadCommandNumSections(), and isPageZeroSegment().
MachO::source_version_command MachOObjectFile::getSourceVersionCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 2327 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
StringRef MachOObjectFile::getStringTableData | ( | ) | const |
Definition at line 2462 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), getSymtabLoadCommand(), llvm::MachO::symtab_command::stroff, llvm::MachO::symtab_command::strsize, and llvm::StringRef::substr().
Referenced by getIndirectName(), and getSymbolName().
Definition at line 2276 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::p, and P.
Referenced by getIndirectName(), and getSymbolAddress().
std::error_code MachOObjectFile::getSymbolAddress | ( | DataRefImpl | Symb, |
uint64_t & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 327 of file MachOObjectFile.cpp.
References getSymbol64TableEntry(), getSymbolTableEntry(), is64Bit(), llvm::MachO::N_TYPE, llvm::MachO::nlist::n_type, llvm::MachO::nlist_64::n_type, llvm::MachO::N_UNDF, llvm::MachO::nlist::n_value, llvm::MachO::nlist_64::n_value, llvm::object::success, and llvm::object::UnknownAddressOrSize.
Referenced by getSymbolFlags(), getSymbolSize(), and sectionContainsSymbol().
std::error_code MachOObjectFile::getSymbolAlignment | ( | DataRefImpl | Symb, |
uint32_t & | Res | ||
) | const [override, virtual] |
Reimplemented from llvm::object::ObjectFile.
Definition at line 347 of file MachOObjectFile.cpp.
References llvm::MachO::GET_COMM_ALIGN(), getSymbolFlags(), getSymbolTableEntryBase(), llvm::MachO::nlist_base::n_desc, llvm::object::BasicSymbolRef::SF_Common, and llvm::object::success.
basic_symbol_iterator MachOObjectFile::getSymbolByIndex | ( | unsigned | Index | ) | const |
Definition at line 1232 of file MachOObjectFile.cpp.
References getPtr(), getSymtabLoadCommand(), is64Bit(), llvm::MachO::symtab_command::nsyms, llvm::object::DataRefImpl::p, llvm::object::ObjectFile::SymbolRef, and llvm::MachO::symtab_command::symoff.
Referenced by llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), and symbol_begin_impl().
uint32_t MachOObjectFile::getSymbolFlags | ( | DataRefImpl | Symb | ) | const [override, virtual] |
Implements llvm::object::SymbolicFile.
Definition at line 432 of file MachOObjectFile.cpp.
References getSymbolAddress(), getSymbolTableEntryBase(), llvm::MachO::N_ABS, llvm::MachO::N_ARM_THUMB_DEF, llvm::MachO::nlist_base::n_desc, llvm::MachO::N_EXT, llvm::MachO::N_INDR, llvm::MachO::N_STAB, llvm::MachO::N_TYPE, llvm::MachO::nlist_base::n_type, llvm::MachO::N_UNDF, llvm::MachO::N_WEAK_DEF, llvm::MachO::N_WEAK_REF, llvm::object::BasicSymbolRef::SF_Absolute, llvm::object::BasicSymbolRef::SF_Common, llvm::object::BasicSymbolRef::SF_FormatSpecific, llvm::object::BasicSymbolRef::SF_Global, llvm::object::BasicSymbolRef::SF_Indirect, llvm::object::BasicSymbolRef::SF_None, llvm::object::BasicSymbolRef::SF_Thumb, llvm::object::BasicSymbolRef::SF_Undefined, llvm::object::BasicSymbolRef::SF_Weak, and llvm::object::UnknownAddressOrSize.
Referenced by getSymbolAlignment(), and getSymbolSize().
std::error_code MachOObjectFile::getSymbolName | ( | DataRefImpl | Symb, |
StringRef & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 294 of file MachOObjectFile.cpp.
References llvm::StringRef::data(), getStringTableData(), getSymbolTableEntryBase(), llvm::MachO::nlist_base::n_strx, and llvm::object::success.
std::error_code MachOObjectFile::getSymbolSection | ( | DataRefImpl | Symb, |
section_iterator & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 471 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getSymbolTableEntryBase(), llvm::MachO::nlist_base::n_sect, section_end(), llvm::object::ObjectFile::SectionRef, and llvm::object::success.
std::error_code MachOObjectFile::getSymbolSize | ( | DataRefImpl | Symb, |
uint64_t & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 359 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getSectionAddress(), getSectionSize(), getSymbolAddress(), getSymbolFlags(), getSymbolTableEntryBase(), llvm::MachO::nlist_base::n_sect, llvm::object::BasicSymbolRef::SF_Common, llvm::object::success, llvm::ARMBuildAttrs::Symbol, llvm::object::ObjectFile::symbols(), and llvm::object::UnknownAddressOrSize.
MachO::nlist MachOObjectFile::getSymbolTableEntry | ( | DataRefImpl | DRI | ) | const |
Definition at line 2270 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::p, and P.
Referenced by getIndirectName(), and getSymbolAddress().
std::error_code MachOObjectFile::getSymbolType | ( | DataRefImpl | Symb, |
SymbolRef::Type & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 408 of file MachOObjectFile.cpp.
References getSymbolTableEntryBase(), llvm::MachO::N_SECT, llvm::MachO::N_STAB, llvm::MachO::N_TYPE, llvm::MachO::nlist_base::n_type, llvm::MachO::N_UNDF, llvm::object::SymbolRef::ST_Debug, llvm::object::SymbolRef::ST_Function, llvm::object::SymbolRef::ST_Other, llvm::object::SymbolRef::ST_Unknown, and llvm::object::success.
Referenced by sectionContainsSymbol().
Definition at line 2384 of file MachOObjectFile.cpp.
Referenced by getRelocationSymbol(), getStringTableData(), getSymbolByIndex(), and symbol_end_impl().
Triple MachOObjectFile::getThumbArch | ( | uint32_t | CPUType, |
uint32_t | CPUSubType, | ||
const char ** | McpuDefault = nullptr |
||
) | [static] |
Definition at line 1393 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_SUBTYPE_ARM_V4T, llvm::MachO::CPU_SUBTYPE_ARM_V5TEJ, llvm::MachO::CPU_SUBTYPE_ARM_V6, llvm::MachO::CPU_SUBTYPE_ARM_V6M, llvm::MachO::CPU_SUBTYPE_ARM_V7, llvm::MachO::CPU_SUBTYPE_ARM_V7EM, llvm::MachO::CPU_SUBTYPE_ARM_V7K, llvm::MachO::CPU_SUBTYPE_ARM_V7M, llvm::MachO::CPU_SUBTYPE_ARM_V7S, llvm::MachO::CPU_SUBTYPE_ARM_XSCALE, llvm::MachO::CPU_SUBTYPE_MASK, and llvm::MachO::CPU_TYPE_ARM.
Referenced by getArch().
Definition at line 2322 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::version_min_command MachOObjectFile::getVersionMinLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 2302 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
StringRef MachOObjectFile::guessLibraryShortName | ( | StringRef | Name, |
bool & | isFramework, | ||
StringRef & | Suffix | ||
) | [static] |
Definition at line 1063 of file MachOObjectFile.cpp.
References F(), llvm::StringRef::find(), llvm::StringRef::npos, llvm::StringRef::rfind(), llvm::StringRef::size(), llvm::StringRef::slice(), and llvm::StringRef::startswith().
Referenced by getLibraryShortNameByIndex().
bool llvm::object::MachOObjectFile::hasPageZeroSegment | ( | ) | const [inline] |
Definition at line 408 of file Object/MachO.h.
bool MachOObjectFile::is64Bit | ( | ) | const |
Definition at line 2467 of file MachOObjectFile.cpp.
References llvm::object::Binary::getMachOType(), and llvm::object::Binary::getType().
Referenced by getBytesInAddress(), getFileFormatName(), getFirstLoadCommandInfo(), getIndirectName(), getRelocation(), getRelocationSymbol(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionFlags(), getSectionPtr(), getSectionSize(), getSegmentLoadCommandNumSections(), getSymbolAddress(), getSymbolByIndex(), isPageZeroSegment(), lazyBindTable(), MachOObjectFile(), moveSymbolNext(), llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), symbol_end_impl(), and weakBindTable().
bool MachOObjectFile::isRelocatableObject | ( | ) | const [override, virtual] |
True if this is a relocatable object (.o/.obj).
Implements llvm::object::ObjectFile.
Definition at line 2484 of file MachOObjectFile.cpp.
References llvm::MachO::mach_header::filetype, getHeader(), and llvm::MachO::MH_OBJECT.
Definition at line 2159 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_TYPE_X86_64, getCPUType(), getPlainRelocationAddress(), and llvm::MachO::R_SCATTERED.
Referenced by getAnyRelocationAddress(), getAnyRelocationLength(), getAnyRelocationPCRel(), getAnyRelocationType(), getRelocationSection(), getRelocationSymbol(), printRelocationTargetName(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
std::error_code MachOObjectFile::isSectionBSS | ( | DataRefImpl | Sec, |
bool & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 574 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_ATTR_PURE_INSTRUCTIONS, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, llvm::MachO::SECTION_TYPE, and llvm::object::success.
std::error_code MachOObjectFile::isSectionData | ( | DataRefImpl | Sec, |
bool & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 564 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_ATTR_PURE_INSTRUCTIONS, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, llvm::MachO::SECTION_TYPE, and llvm::object::success.
std::error_code MachOObjectFile::isSectionReadOnlyData | ( | DataRefImpl | Sec, |
bool & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 608 of file MachOObjectFile.cpp.
References llvm::object::success.
std::error_code MachOObjectFile::isSectionRequiredForExecution | ( | DataRefImpl | Sec, |
bool & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 585 of file MachOObjectFile.cpp.
References llvm::object::success.
std::error_code MachOObjectFile::isSectionText | ( | DataRefImpl | Sec, |
bool & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 557 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_ATTR_PURE_INSTRUCTIONS, and llvm::object::success.
std::error_code MachOObjectFile::isSectionVirtual | ( | DataRefImpl | Sec, |
bool & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 592 of file MachOObjectFile.cpp.
References llvm::object::success.
std::error_code MachOObjectFile::isSectionZeroInit | ( | DataRefImpl | Sec, |
bool & | Res | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 599 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, llvm::MachO::SECTION_TYPE, and llvm::object::success.
bool MachOObjectFile::isValidArch | ( | StringRef | ArchFlag | ) | [static] |
Definition at line 1448 of file MachOObjectFile.cpp.
References llvm::StringSwitch< T, R >::Case(), and llvm::StringSwitch< T, R >::Default().
iterator_range< bind_iterator > MachOObjectFile::lazyBindTable | ( | ) | const |
For use iterating over all lazy bind table entries.
Definition at line 2128 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoLazyBindOpcodes(), and is64Bit().
void MachOObjectFile::moveRelocationNext | ( | DataRefImpl & | Rel | ) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 665 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::b, and llvm::object::DataRefImpl::d.
Referenced by getRelocationValueString().
void MachOObjectFile::moveSectionNext | ( | DataRefImpl & | Sec | ) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 487 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
void MachOObjectFile::moveSymbolNext | ( | DataRefImpl & | Symb | ) | const [override, virtual] |
Implements llvm::object::SymbolicFile.
Definition at line 287 of file MachOObjectFile.cpp.
References is64Bit(), and llvm::object::DataRefImpl::p.
void MachOObjectFile::ReadULEB128s | ( | uint64_t | Index, |
SmallVectorImpl< uint64_t > & | Out | ||
) | const |
Definition at line 2472 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), llvm::DataExtractor::getULEB128(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
For use iterating over all rebase table entries.
iterator_range< rebase_iterator > MachOObjectFile::rebaseTable | ( | ArrayRef< uint8_t > | Opcodes, |
bool | is64 | ||
) | [static] |
For use examining rebase opcodes not in a MachOObjectFile.
Definition at line 1857 of file MachOObjectFile.cpp.
section_iterator MachOObjectFile::section_begin | ( | ) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 1246 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::SectionRef.
Referenced by llvm::RuntimeDyldMachO::getSectionByAddress(), and printRelocationTargetName().
section_iterator MachOObjectFile::section_end | ( | ) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 1251 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, llvm::object::ObjectFile::SectionRef, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by getRelocationSection(), llvm::RuntimeDyldMachO::getSectionByAddress(), and getSymbolSection().
relocation_iterator llvm::object::MachOObjectFile::section_rel_begin | ( | DataRefImpl | Sec | ) | const [override, virtual] |
Implements llvm::object::ObjectFile.
relocation_iterator llvm::object::MachOObjectFile::section_rel_end | ( | DataRefImpl | Sec | ) | const [override, virtual] |
Implements llvm::object::ObjectFile.
std::error_code MachOObjectFile::sectionContainsSymbol | ( | DataRefImpl | Sec, |
DataRefImpl | Symb, | ||
bool & | Result | ||
) | const [override, virtual] |
Implements llvm::object::ObjectFile.
Definition at line 619 of file MachOObjectFile.cpp.
References getSectionAddress(), getSectionSize(), getSymbolAddress(), getSymbolType(), llvm::AArch64DB::ST, llvm::object::SymbolRef::ST_Unknown, and llvm::object::success.
basic_symbol_iterator MachOObjectFile::symbol_begin_impl | ( | ) | const [override, virtual] |
Implements llvm::object::SymbolicFile.
Definition at line 1213 of file MachOObjectFile.cpp.
References getSymbolByIndex().
basic_symbol_iterator MachOObjectFile::symbol_end_impl | ( | ) | const [override, virtual] |
Implements llvm::object::SymbolicFile.
Definition at line 1217 of file MachOObjectFile.cpp.
References getPtr(), getSymtabLoadCommand(), is64Bit(), llvm::MachO::symtab_command::nsyms, llvm::object::DataRefImpl::p, llvm::object::ObjectFile::SymbolRef, and llvm::MachO::symtab_command::symoff.
iterator_range< bind_iterator > MachOObjectFile::weakBindTable | ( | ) | const |
For use iterating over all lazy bind table entries.
Definition at line 2133 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoWeakBindOpcodes(), and is64Bit().