LLVM 17.0.0git
|
#include "llvm/Object/MachO.h"
Classes | |
struct | LoadCommandInfo |
Public Types | |
using | LoadCommandList = SmallVector< LoadCommandInfo, 4 > |
using | load_command_iterator = LoadCommandList::const_iterator |
![]() | |
using | symbol_iterator_range = iterator_range< symbol_iterator > |
using | section_iterator_range = iterator_range< section_iterator > |
![]() | |
using | basic_symbol_iterator_range = iterator_range< basic_symbol_iterator > |
dice_iterator MachOObjectFile::begin_dices | ( | ) | const |
Definition at line 2894 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, getDataInCodeLoadCommand(), getPtr(), and llvm::object::DataRefImpl::p.
MachOObjectFile::load_command_iterator MachOObjectFile::begin_load_commands | ( | ) | const |
Definition at line 4495 of file MachOObjectFile.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
Referenced by load_commands().
|
inline |
Definition at line 577 of file MachO.h.
Referenced by llvm::object::MachOBindEntry::moveNext().
|
inline |
For use with a SegIndex,SegOffset pair from a checked Mach-O Bind or Rebase entry to get the address.
Definition at line 613 of file MachO.h.
Referenced by llvm::object::MachORebaseEntry::address(), llvm::object::MachOBindEntry::address(), llvm::object::MachOAbstractFixupEntry::address(), and llvm::object::MachOAbstractFixupEntry::segmentAddress().
|
inline |
For use with a SegIndex,SegOffset pair from a checked Mach-O Bind or Rebase entry to get the section name.
Definition at line 607 of file MachO.h.
Referenced by llvm::object::MachORebaseEntry::sectionName(), llvm::object::MachOBindEntry::sectionName(), and llvm::object::MachOAbstractFixupEntry::sectionName().
|
inline |
For use with the SegIndex of a checked Mach-O Bind or Rebase entry to get the segment name.
Definition at line 601 of file MachO.h.
Referenced by llvm::object::MachORebaseEntry::segmentName(), llvm::object::MachOBindEntry::segmentName(), and llvm::object::MachOAbstractFixupEntry::segmentName().
iterator_range< bind_iterator > MachOObjectFile::bindTable | ( | Error & | Err | ) |
For use iterating over all bind table entries.
Definition at line 4466 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Regular.
Referenced by bindTable(), lazyBindTable(), and weakBindTable().
|
static |
For use examining bind opcodes in a MachOObjectFile.
Definition at line 4452 of file MachOObjectFile.cpp.
References llvm::make_range().
Error MachOObjectFile::checkSymbolTable | ( | ) | const |
Definition at line 1693 of file MachOObjectFile.cpp.
References llvm::MachO::DYNAMIC_LOOKUP_ORDINAL, llvm::MachO::EXECUTABLE_ORDINAL, llvm::MachO::mach_header_64::flags, Flags, llvm::MachO::GET_LIBRARY_ORDINAL(), getHeader(), getHeader64(), getSymbol64TableEntry(), getSymbolTableEntry(), getSymtabLoadCommand(), H, is64Bit(), malformedError(), llvm::MachO::MH_TWOLEVEL, llvm::MachO::nlist::n_desc, llvm::MachO::nlist_64::n_desc, llvm::MachO::N_INDR, llvm::MachO::N_PBUD, llvm::MachO::N_SECT, llvm::MachO::nlist::n_sect, llvm::MachO::nlist_64::n_sect, llvm::MachO::N_STAB, llvm::MachO::nlist::n_strx, llvm::MachO::nlist_64::n_strx, 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::SmallVectorBase< Size_T >::size(), llvm::MachO::symtab_command::strsize, llvm::Error::success(), and llvm::object::ObjectFile::symbols().
|
static |
Definition at line 1248 of file MachOObjectFile.cpp.
References llvm::Object, and llvm::Error::success().
Referenced by llvm::object::ObjectFile::createMachOObjectFile().
dice_iterator MachOObjectFile::end_dices | ( | ) | const |
Definition at line 2904 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, getDataInCodeLoadCommand(), getPtr(), llvm::Offset, and llvm::object::DataRefImpl::p.
MachOObjectFile::load_command_iterator MachOObjectFile::end_load_commands | ( | ) | const |
Definition at line 4500 of file MachOObjectFile.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by load_commands().
iterator_range< export_iterator > MachOObjectFile::exports | ( | Error & | Err | ) | const |
For use iterating over all exported symbols.
Definition at line 3235 of file MachOObjectFile.cpp.
References exports(), getDyldExportsTrie(), and getDyldInfoExportsTrie().
Referenced by exports().
|
static |
For use examining a trie not in a MachOObjectFile.
Definition at line 3221 of file MachOObjectFile.cpp.
References E, llvm::ArrayRef< T >::empty(), and llvm::make_range().
|
inline |
Definition at line 478 of file MachO.h.
References extrel_begin(), extrel_end(), and llvm::make_range().
relocation_iterator MachOObjectFile::extrel_begin | ( | ) | const |
Definition at line 2191 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::RelocationRef.
Referenced by external_relocations().
relocation_iterator MachOObjectFile::extrel_end | ( | ) | const |
Definition at line 2199 of file MachOObjectFile.cpp.
References getDysymtabLoadCommand(), llvm::MachO::dysymtab_command::nextrel, and llvm::object::ObjectFile::RelocationRef.
Referenced by external_relocations().
|
static |
If the input path is a .dSYM bundle (as created by the dsymutil tool), return the paths to the object files found in the bundle, otherwise return an empty vector.
If the path appears to be a .dSYM bundle but no objects were found or there was a filesystem error, then return an error.
Definition at line 5331 of file MachOObjectFile.cpp.
References llvm::sys::path::append(), llvm::createFileError(), llvm::createStringError(), llvm::errorCodeToError(), llvm::sys::path::extension(), llvm::sys::fs::is_directory(), llvm::no_such_file_or_directory, llvm::sys::fs::regular_file, llvm::sys::path::remove_dots(), llvm::sys::fs::status(), llvm::StringRef::str(), llvm::sys::fs::symlink_file, and llvm::sys::fs::type_unknown.
Referenced by llvm::InstrProfCorrelator::get().
iterator_range< fixup_iterator > MachOObjectFile::fixupTable | ( | Error & | Err | ) |
For iterating over all chained fixups.
Definition at line 4481 of file MachOObjectFile.cpp.
References llvm::make_range(), and llvm::object::MachOChainedFixupEntry::moveToEnd().
unsigned MachOObjectFile::getAnyRelocationAddress | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4568 of file MachOObjectFile.cpp.
References getPlainRelocationAddress(), getScatteredRelocationAddress(), and isRelocationScattered().
Referenced by getRelocationOffset().
unsigned MachOObjectFile::getAnyRelocationLength | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4582 of file MachOObjectFile.cpp.
References getPlainRelocationLength(), getScatteredRelocationLength(), and isRelocationScattered().
Referenced by llvm::RuntimeDyldMachO::getRelocationEntry(), getRelocationLength(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
unsigned MachOObjectFile::getAnyRelocationPCRel | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4575 of file MachOObjectFile.cpp.
References getPlainRelocationPCRel(), getScatteredRelocationPCRel(), and isRelocationScattered().
Referenced by llvm::RuntimeDyldMachO::getRelocationEntry(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
SectionRef MachOObjectFile::getAnyRelocationSection | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4598 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getPlainRelocationExternal(), getPlainRelocationSymbolNum(), isRelocationScattered(), llvm::MachO::R_ABS, section_end(), and llvm::object::ObjectFile::SectionRef.
Referenced by getRelocationSection(), and llvm::RuntimeDyldMachO::getRelocationValueRef().
unsigned MachOObjectFile::getAnyRelocationType | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4590 of file MachOObjectFile.cpp.
References getPlainRelocationType(), getScatteredRelocationType(), and isRelocationScattered().
Referenced by extractSections(), llvm::RuntimeDyldMachO::getRelocationEntry(), getRelocationType(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2874 of file MachOObjectFile.cpp.
References getArch(), getCPUSubType(), and getCPUType().
Referenced by getArch(), and getRelocationTypeName().
|
static |
Definition at line 2682 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::Triple::aarch64_32, llvm::Triple::arm, llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_TYPE_ARM64_32, 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.
Definition at line 2878 of file MachOObjectFile.cpp.
References llvm::MachO::mach_header::cpusubtype, llvm::MachO::mach_header::cputype, getArchTriple(), and Header.
Referenced by llvm::object::Slice::create(), llvm::object::MachOUniversalBinary::ObjectForArch::getArchFlagName(), getArchTriple(), and llvm::object::MachOUniversalBinary::ObjectForArch::getTriple().
|
static |
Definition at line 2703 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_SUBTYPE_ARM64_32_V8, llvm::MachO::CPU_SUBTYPE_ARM64_ALL, llvm::MachO::CPU_SUBTYPE_ARM64E, 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_I386_ALL, llvm::MachO::CPU_SUBTYPE_MASK, llvm::MachO::CPU_SUBTYPE_POWERPC_ALL, llvm::MachO::CPU_SUBTYPE_X86_64_ALL, llvm::MachO::CPU_SUBTYPE_X86_64_H, llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_TYPE_ARM64_32, llvm::MachO::CPU_TYPE_I386, llvm::MachO::CPU_TYPE_POWERPC, llvm::MachO::CPU_TYPE_POWERPC64, and llvm::MachO::CPU_TYPE_X86_64.
|
inlinestatic |
Definition at line 785 of file MachO.h.
References llvm::format_hex(), llvm::MachO::PLATFORM_BRIDGEOS, llvm::MachO::PLATFORM_DRIVERKIT, llvm::MachO::PLATFORM_IOS, llvm::MachO::PLATFORM_IOSSIMULATOR, llvm::MachO::PLATFORM_MACCATALYST, llvm::MachO::PLATFORM_MACOS, llvm::MachO::PLATFORM_TVOS, llvm::MachO::PLATFORM_TVOSSIMULATOR, llvm::MachO::PLATFORM_WATCHOS, llvm::MachO::PLATFORM_WATCHOSSIMULATOR, and llvm::raw_string_ostream::str().
|
inlinestatic |
Definition at line 805 of file MachO.h.
References llvm::format_hex(), llvm::raw_string_ostream::str(), llvm::MachO::TOOL_CLANG, llvm::MachO::TOOL_LD, and llvm::MachO::TOOL_SWIFT.
MachO::build_tool_version MachOObjectFile::getBuildToolVersion | ( | unsigned | index | ) | const |
Definition at line 4680 of file MachOObjectFile.cpp.
MachO::build_version_command MachOObjectFile::getBuildVersionLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4675 of file MachOObjectFile.cpp.
|
overridevirtual |
The number of bytes used to represent an address in this object file format.
Implements llvm::object::ObjectFile.
Definition at line 2649 of file MachOObjectFile.cpp.
References is64Bit().
Expected< std::optional< MachO::dyld_chained_fixups_header > > MachOObjectFile::getChainedFixupsHeader | ( | ) | const |
If the optional is None, no header was found, but the object was well-formed.
Definition at line 4983 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, llvm::MachO::dyld_chained_fixups_header::fixups_version, getChainedFixupsLoadCommand(), getPtr(), llvm::MachO::dyld_chained_fixups_header::imports_format, malformedError(), and llvm::MachO::dyld_chained_fixups_header::starts_offset.
Referenced by getChainedFixupsSegments(), and getDyldChainedFixupTargets().
Expected< std::optional< MachO::linkedit_data_command > > MachOObjectFile::getChainedFixupsLoadCommand | ( | ) | const |
Definition at line 4964 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff.
Referenced by getChainedFixupsHeader(), getChainedFixupsSegments(), and getDyldChainedFixupTargets().
Expected< std::pair< size_t, std::vector< ChainedFixupsSegment > > > MachOObjectFile::getChainedFixupsSegments | ( | ) | const |
Definition at line 5034 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, Fail, getChainedFixupsHeader(), getChainedFixupsLoadCommand(), getPtr(), Header, I, llvm::object::Binary::isLittleEndian(), llvm::sys::IsLittleEndianHost, malformedError(), N, offsetof, llvm::MachO::dyld_chained_starts_in_segment::page_count, llvm::MachO::dyld_chained_starts_in_segment::pointer_format, llvm::MachO::dyld_chained_starts_in_image::seg_count, llvm::MachO::dyld_chained_starts_in_segment::size, and llvm::sys::swapByteOrder().
Referenced by llvm::object::MachOChainedFixupEntry::MachOChainedFixupEntry().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1830 of file MachOObjectFile.cpp.
References getNValue().
MachO::linkedit_data_command MachOObjectFile::getDataInCodeLoadCommand | ( | ) | const |
Definition at line 4865 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::cmd, llvm::MachO::linkedit_data_command::cmdsize, llvm::MachO::linkedit_data_command::dataoff, and llvm::MachO::linkedit_data_command::datasize.
Referenced by begin_dices(), and end_dices().
MachO::data_in_code_entry MachOObjectFile::getDataInCodeTableEntry | ( | uint32_t | DataOffset, |
unsigned | Index | ||
) | const |
Definition at line 4814 of file MachOObjectFile.cpp.
References getPtr(), and llvm::Offset.
MachO::data_in_code_entry MachOObjectFile::getDice | ( | DataRefImpl | Rel | ) | const |
Definition at line 4792 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().
Expected< std::vector< ChainedFixupTarget > > MachOObjectFile::getDyldChainedFixupTargets | ( | ) | const |
Definition at line 5143 of file MachOObjectFile.cpp.
References llvm::object::createError(), llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, llvm::MachO::DYLD_CHAINED_IMPORT, llvm::MachO::DYLD_CHAINED_IMPORT_ADDEND, llvm::MachO::DYLD_CHAINED_IMPORT_ADDEND64, getChainedFixupsHeader(), getChainedFixupsLoadCommand(), getPtr(), Header, llvm::object::Binary::isLittleEndian(), llvm_unreachable, malformedError(), and Targets.
Referenced by llvm::object::MachOChainedFixupEntry::MachOChainedFixupEntry().
ArrayRef< uint8_t > MachOObjectFile::getDyldExportsTrie | ( | ) | const |
Definition at line 5240 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, getPtr(), and Ptr.
Referenced by exports().
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoBindOpcodes | ( | ) | const |
Definition at line 4907 of file MachOObjectFile.cpp.
References llvm::MachO::dyld_info_command::bind_off, llvm::MachO::dyld_info_command::bind_size, getPtr(), and Ptr.
Referenced by bindTable().
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoExportsTrie | ( | ) | const |
Definition at line 4949 of file MachOObjectFile.cpp.
References llvm::MachO::dyld_info_command::export_off, llvm::MachO::dyld_info_command::export_size, getPtr(), and Ptr.
Referenced by exports().
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoLazyBindOpcodes | ( | ) | const |
Definition at line 4935 of file MachOObjectFile.cpp.
References getPtr(), llvm::MachO::dyld_info_command::lazy_bind_off, llvm::MachO::dyld_info_command::lazy_bind_size, and Ptr.
Referenced by lazyBindTable().
MachO::dyld_info_command MachOObjectFile::getDyldInfoLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4690 of file MachOObjectFile.cpp.
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoRebaseOpcodes | ( | ) | const |
Definition at line 4893 of file MachOObjectFile.cpp.
References getPtr(), Ptr, llvm::MachO::dyld_info_command::rebase_off, and llvm::MachO::dyld_info_command::rebase_size.
Referenced by rebaseTable().
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoWeakBindOpcodes | ( | ) | const |
Definition at line 4921 of file MachOObjectFile.cpp.
References getPtr(), Ptr, llvm::MachO::dyld_info_command::weak_bind_off, and llvm::MachO::dyld_info_command::weak_bind_size.
Referenced by weakBindTable().
MachO::dylib_command MachOObjectFile::getDylibIDLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4685 of file MachOObjectFile.cpp.
MachO::dylinker_command MachOObjectFile::getDylinkerCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4695 of file MachOObjectFile.cpp.
MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand | ( | ) | const |
Definition at line 4835 of file MachOObjectFile.cpp.
References llvm::MachO::dysymtab_command::cmd, llvm::MachO::dysymtab_command::cmdsize, llvm::MachO::dysymtab_command::extrefsymoff, llvm::MachO::dysymtab_command::extreloff, llvm::MachO::dysymtab_command::iextdefsym, llvm::MachO::dysymtab_command::ilocalsym, llvm::MachO::dysymtab_command::indirectsymoff, llvm::MachO::dysymtab_command::iundefsym, llvm::MachO::dysymtab_command::locreloff, llvm::MachO::dysymtab_command::modtaboff, llvm::MachO::dysymtab_command::nextdefsym, llvm::MachO::dysymtab_command::nextrefsyms, llvm::MachO::dysymtab_command::nextrel, llvm::MachO::dysymtab_command::nindirectsyms, llvm::MachO::dysymtab_command::nlocalsym, llvm::MachO::dysymtab_command::nlocrel, llvm::MachO::dysymtab_command::nmodtab, llvm::MachO::dysymtab_command::ntoc, llvm::MachO::dysymtab_command::nundefsym, and llvm::MachO::dysymtab_command::tocoff.
Referenced by extrel_end(), getRelocation(), locrel_end(), and llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
MachO::encryption_info_command MachOObjectFile::getEncryptionInfoCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4720 of file MachOObjectFile.cpp.
MachO::encryption_info_command_64 MachOObjectFile::getEncryptionInfoCommand64 | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4725 of file MachOObjectFile.cpp.
MachO::entry_point_command MachOObjectFile::getEntryPointCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4715 of file MachOObjectFile.cpp.
|
inlineoverridevirtual |
Implements llvm::object::ObjectFile.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2653 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_TYPE_ARM64_32, llvm::MachO::CPU_TYPE_I386, llvm::MachO::CPU_TYPE_POWERPC, llvm::MachO::CPU_TYPE_POWERPC64, llvm::MachO::CPU_TYPE_X86_64, getCPUType(), and is64Bit().
SmallVector< uint64_t > MachOObjectFile::getFunctionStarts | ( | ) | const |
Definition at line 5254 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, Info, and ReadULEB128s().
const MachO::mach_header & MachOObjectFile::getHeader | ( | ) | const |
Definition at line 4797 of file MachOObjectFile.cpp.
References Header.
Referenced by checkDylibIdCommand(), checkSymbolTable(), extractSections(), getFirstLoadCommandInfo(), getNextLoadCommandInfo(), getRelocation(), getRelocationOffset(), isRelocatableObject(), and parseSegmentLoadCommand().
const MachO::mach_header_64 & MachOObjectFile::getHeader64 | ( | ) | const |
Definition at line 4801 of file MachOObjectFile.cpp.
References assert(), Header64, and is64Bit().
Referenced by checkSymbolTable(), and llvm::jitlink::MachOLinkGraphBuilder::MachOLinkGraphBuilder().
|
static |
Definition at line 2840 of file MachOObjectFile.cpp.
References llvm::sys::getDefaultTargetTriple().
std::error_code MachOObjectFile::getIndirectName | ( | DataRefImpl | Symb, |
StringRef & | Res | ||
) | const |
Definition at line 1799 of file MachOObjectFile.cpp.
References getNValue(), getStringTableData(), getSymbolTableEntryBase(), llvm::MachO::N_INDR, llvm::MachO::N_TYPE, and llvm::object::parse_failed.
uint32_t MachOObjectFile::getIndirectSymbolTableEntry | ( | const MachO::dysymtab_command & | DLC, |
unsigned | Index | ||
) | const |
Definition at line 4806 of file MachOObjectFile.cpp.
References getPtr(), and llvm::Offset.
Referenced by llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
uint32_t MachOObjectFile::getLibraryCount | ( | ) | const |
Definition at line 2579 of file MachOObjectFile.cpp.
References llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::object::MachOBindEntry::moveNext().
std::error_code MachOObjectFile::getLibraryShortNameByIndex | ( | unsigned | Index, |
StringRef & | Res | ||
) | const |
Definition at line 2545 of file MachOObjectFile.cpp.
References D, llvm::StringRef::empty(), guessLibraryShortName(), Name, P, llvm::object::parse_failed, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().
MachO::linkedit_data_command MachOObjectFile::getLinkeditDataLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4645 of file MachOObjectFile.cpp.
MachO::linker_option_command MachOObjectFile::getLinkerOptionLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4660 of file MachOObjectFile.cpp.
MachO::linkedit_data_command MachOObjectFile::getLinkOptHintsLoadCommand | ( | ) | const |
Definition at line 4879 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::cmd, llvm::MachO::linkedit_data_command::cmdsize, llvm::MachO::linkedit_data_command::dataoff, and llvm::MachO::linkedit_data_command::datasize.
MachO::note_command MachOObjectFile::getNoteLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4670 of file MachOObjectFile.cpp.
uint64_t MachOObjectFile::getNValue | ( | DataRefImpl | Sym | ) | const |
Definition at line 1788 of file MachOObjectFile.cpp.
References getSymbol64TableEntry(), getSymbolTableEntry(), and is64Bit().
Referenced by getCommonSymbolSizeImpl(), getIndirectName(), and getSymbolFlags().
bool MachOObjectFile::getPlainRelocationExternal | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4546 of file MachOObjectFile.cpp.
References llvm::object::Binary::isLittleEndian(), and llvm::MachO::any_relocation_info::r_word1.
Referenced by extractSections(), getAnyRelocationSection(), getRelocationSymbol(), llvm::RuntimeDyldMachO::getRelocationValueRef(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), and llvm::RuntimeDyldMachOX86_64::processRelocationRef().
unsigned MachOObjectFile::getPlainRelocationSymbolNum | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4539 of file MachOObjectFile.cpp.
References llvm::object::Binary::isLittleEndian(), and llvm::MachO::any_relocation_info::r_word1.
Referenced by getAnyRelocationSection(), getRelocationSymbol(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
MachO::any_relocation_info MachOObjectFile::getRelocation | ( | DataRefImpl | Rel | ) | const |
Definition at line 4765 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, llvm::MachO::dysymtab_command::extreloff, getDysymtabLoadCommand(), getHeader(), getPtr(), getSection(), getSection64(), is64Bit(), llvm::MachO::dysymtab_command::locreloff, llvm::MachO::MH_OBJECT, llvm::Offset, P, llvm::MachO::section::reloff, and llvm::MachO::section_64::reloff.
Referenced by extractSections(), llvm::RuntimeDyldMachO::getRelocationEntry(), llvm::jitlink::MachOLinkGraphBuilder::getRelocationInfo(), getRelocationLength(), getRelocationOffset(), getRelocationSection(), getRelocationSymbol(), getRelocationType(), llvm::RuntimeDyldMachO::getRelocationValueRef(), isRelocScattered(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
uint8_t MachOObjectFile::getRelocationLength | ( | DataRefImpl | Rel | ) | const |
Definition at line 2378 of file MachOObjectFile.cpp.
References getAnyRelocationLength(), and getRelocation().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2229 of file MachOObjectFile.cpp.
References assert(), getAnyRelocationAddress(), getHeader(), getRelocation(), llvm::MachO::MH_KEXT_BUNDLE, and llvm::MachO::MH_OBJECT.
section_iterator MachOObjectFile::getRelocationRelocatedSection | ( | relocation_iterator | Rel | ) | const |
Definition at line 2584 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and llvm::object::ObjectFile::SectionRef.
section_iterator MachOObjectFile::getRelocationSection | ( | DataRefImpl | Rel | ) | const |
Definition at line 2259 of file MachOObjectFile.cpp.
References getAnyRelocationSection(), and getRelocation().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2238 of file MachOObjectFile.cpp.
References getPlainRelocationExternal(), getPlainRelocationSymbolNum(), getPtr(), getRelocation(), getSymtabLoadCommand(), is64Bit(), isRelocationScattered(), llvm::Offset, llvm::object::DataRefImpl::p, symbol_end(), llvm::object::ObjectFile::SymbolRef, llvm::XCOFF::SymbolTableEntrySize, and llvm::MachO::symtab_command::symoff.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2263 of file MachOObjectFile.cpp.
References getAnyRelocationType(), and getRelocation().
Referenced by getRelocationTypeName().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2268 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::Triple::aarch64_32, llvm::Triple::arm, llvm::StringRef::begin(), llvm::StringRef::end(), getArch(), getRelocationType(), llvm::Triple::ppc, llvm::Triple::UnknownArch, llvm::Triple::x86, and llvm::Triple::x86_64.
MachO::routines_command MachOObjectFile::getRoutinesCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4750 of file MachOObjectFile.cpp.
MachO::routines_command_64 MachOObjectFile::getRoutinesCommand64 | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4755 of file MachOObjectFile.cpp.
MachO::rpath_command MachOObjectFile::getRpathCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4705 of file MachOObjectFile.cpp.
bool MachOObjectFile::getScatteredRelocationScattered | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4553 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word0.
uint32_t MachOObjectFile::getScatteredRelocationType | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4563 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word0.
Referenced by getAnyRelocationType().
uint32_t MachOObjectFile::getScatteredRelocationValue | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4558 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word1.
Referenced by llvm::RuntimeDyldMachO::processScatteredVANILLA().
MachO::section MachOObjectFile::getSection | ( | const LoadCommandInfo & | L, |
unsigned | Index | ||
) | const |
Definition at line 4620 of file MachOObjectFile.cpp.
References getSectionPtr().
MachO::section MachOObjectFile::getSection | ( | DataRefImpl | DRI | ) | const |
Definition at line 4610 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), and llvm::object::DataRefImpl::d.
Expected< SectionRef > MachOObjectFile::getSection | ( | StringRef | SectionName | ) | const |
Definition at line 2018 of file MachOObjectFile.cpp.
References llvm::errorCodeToError(), llvm::object::parse_failed, and llvm::object::ObjectFile::sections().
Expected< SectionRef > MachOObjectFile::getSection | ( | unsigned | SectionIndex | ) | const |
Definition at line 2009 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, malformedError(), llvm::object::ObjectFile::SectionRef, and llvm::SmallVectorBase< Size_T >::size().
Referenced by extractSections(), getRelocation(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionSize(), isSectionStripped(), llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), and section_rel_end().
MachO::section_64 MachOObjectFile::getSection64 | ( | const LoadCommandInfo & | L, |
unsigned | Index | ||
) | const |
Definition at line 4626 of file MachOObjectFile.cpp.
References getSectionPtr().
MachO::section_64 MachOObjectFile::getSection64 | ( | DataRefImpl | DRI | ) | const |
Definition at line 4615 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), and llvm::object::DataRefImpl::d.
Referenced by getRelocation(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionSize(), isSectionStripped(), and section_rel_end().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1934 of file MachOObjectFile.cpp.
References llvm::MachO::section_64::addr, getSection(), getSection64(), and is64Bit().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1996 of file MachOObjectFile.cpp.
References llvm::MachO::section::align, llvm::MachO::section_64::align, getSection(), getSection64(), and is64Bit().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1979 of file MachOObjectFile.cpp.
References getSection(), getSection64(), getSectionContents(), is64Bit(), llvm::MachO::section::offset, llvm::MachO::section_64::offset, llvm::Offset, llvm::MachO::section::size, llvm::MachO::section_64::size, and Size.
Definition at line 1973 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), llvm::Offset, Size, and substr().
Referenced by extractSections(), and getSectionContents().
StringRef MachOObjectFile::getSectionFinalSegmentName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4510 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), getSectionRawFinalSegmentName(), and parseSegmentOrSectionName().
Referenced by llvm::object::BindRebaseSegInfo::BindRebaseSegInfo(), llvm::orc::getMachOObjectFileSymbolInfo(), and isSectionBitcode().
unsigned MachOObjectFile::getSectionID | ( | SectionRef | Sec | ) | const |
Definition at line 2143 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and llvm::object::SectionRef::getRawDataRefImpl().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1940 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1929 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), getSectionRawName(), and parseSegmentOrSectionName().
Referenced by llvm::orc::getMachOObjectFileSymbolInfo(), isDebugSection(), and isSectionBitcode().
ArrayRef< char > MachOObjectFile::getSectionRawFinalSegmentName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4524 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), llvm::sampleprof::Base, and llvm::object::DataRefImpl::d.
Referenced by getSectionFinalSegmentName().
ArrayRef< char > MachOObjectFile::getSectionRawName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4516 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), llvm::sampleprof::Base, and llvm::object::DataRefImpl::d.
Referenced by getSectionName().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1944 of file MachOObjectFile.cpp.
References llvm::MachO::section::flags, llvm::MachO::section_64::flags, llvm::object::Binary::getData(), getSection(), getSection64(), is64Bit(), llvm::MachO::section::offset, llvm::MachO::section_64::offset, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, llvm::MachO::SECTION_TYPE, llvm::StringRef::size(), llvm::MachO::section::size, and llvm::MachO::section_64::size.
unsigned MachOObjectFile::getSectionType | ( | SectionRef | Sec | ) | const |
Definition at line 1782 of file MachOObjectFile.cpp.
References Flags, llvm::object::SectionRef::getRawDataRefImpl(), getSectionFlags(), and llvm::MachO::SECTION_TYPE.
Referenced by llvm::orc::getMachOObjectFileSymbolInfo().
MachO::segment_command_64 MachOObjectFile::getSegment64LoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4655 of file MachOObjectFile.cpp.
Referenced by llvm::object::MachOAbstractFixupEntry::MachOAbstractFixupEntry().
ArrayRef< uint8_t > MachOObjectFile::getSegmentContents | ( | size_t | SegmentIndex | ) | const |
Definition at line 2122 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::C, llvm::MachO::load_command::cmd, Idx, and load_commands().
Return the raw contents of an entire segment.
Definition at line 2100 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::C, llvm::MachO::load_command::cmd, llvm::ArrayRef< T >::empty(), and load_commands().
MachO::segment_command MachOObjectFile::getSegmentLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4650 of file MachOObjectFile.cpp.
Referenced by llvm::object::MachOAbstractFixupEntry::MachOAbstractFixupEntry().
MachO::source_version_command MachOObjectFile::getSourceVersionCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4710 of file MachOObjectFile.cpp.
StringRef MachOObjectFile::getStringTableData | ( | ) | const |
Definition at line 5277 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().
MachO::sub_client_command MachOObjectFile::getSubClientCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4745 of file MachOObjectFile.cpp.
MachO::sub_framework_command MachOObjectFile::getSubFrameworkCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4730 of file MachOObjectFile.cpp.
MachO::sub_library_command MachOObjectFile::getSubLibraryCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4740 of file MachOObjectFile.cpp.
MachO::sub_umbrella_command MachOObjectFile::getSubUmbrellaCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4735 of file MachOObjectFile.cpp.
MachO::nlist_64 MachOObjectFile::getSymbol64TableEntry | ( | DataRefImpl | DRI | ) | const |
Definition at line 4639 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::p, and P.
Referenced by checkSymbolTable(), and getNValue().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1817 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::getSymbolValue().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 1821 of file MachOObjectFile.cpp.
References llvm::cantFail(), Flags, llvm::MachO::GET_COMM_ALIGN(), getSymbolFlags(), getSymbolTableEntryBase(), and llvm::object::BasicSymbolRef::SF_Common.
symbol_iterator MachOObjectFile::getSymbolByIndex | ( | unsigned | Index | ) | const |
Definition at line 2614 of file MachOObjectFile.cpp.
References getPtr(), getSymtabLoadCommand(), is64Bit(), llvm::MachO::symtab_command::nsyms, llvm::object::DataRefImpl::p, llvm::report_fatal_error(), llvm::object::ObjectFile::SymbolRef, llvm::XCOFF::SymbolTableEntrySize, and llvm::MachO::symtab_command::symoff.
Referenced by llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), and symbol_begin().
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 1860 of file MachOObjectFile.cpp.
References getNValue(), getSymbolTableEntryBase(), llvm::MachO::N_ABS, llvm::MachO::N_ARM_THUMB_DEF, llvm::MachO::N_EXT, llvm::MachO::N_INDR, llvm::MachO::N_PEXT, llvm::MachO::N_STAB, llvm::MachO::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_Exported, llvm::object::BasicSymbolRef::SF_FormatSpecific, llvm::object::BasicSymbolRef::SF_Global, llvm::object::BasicSymbolRef::SF_Hidden, llvm::object::BasicSymbolRef::SF_Indirect, llvm::object::BasicSymbolRef::SF_None, llvm::object::BasicSymbolRef::SF_Thumb, llvm::object::BasicSymbolRef::SF_Undefined, and llvm::object::BasicSymbolRef::SF_Weak.
Referenced by getSymbolAlignment().
uint64_t MachOObjectFile::getSymbolIndex | ( | DataRefImpl | Symb | ) | const |
Definition at line 2626 of file MachOObjectFile.cpp.
References getPtr(), getSymtabLoadCommand(), is64Bit(), llvm::object::DataRefImpl::p, llvm::report_fatal_error(), llvm::XCOFF::SymbolTableEntrySize, and llvm::MachO::symtab_command::symoff.
Referenced by getSymbolName(), and getSymbolSection().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1767 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), getStringTableData(), getSymbolIndex(), getSymbolTableEntryBase(), and malformedError().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1904 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getSymbolIndex(), getSymbolTableEntryBase(), malformedError(), section_end(), llvm::object::ObjectFile::SectionRef, and llvm::SmallVectorBase< Size_T >::size().
Referenced by getSymbolType().
Definition at line 1919 of file MachOObjectFile.cpp.
References llvm::object::BasicSymbolRef::getRawDataRefImpl(), and getSymbolTableEntryBase().
MachO::nlist MachOObjectFile::getSymbolTableEntry | ( | DataRefImpl | DRI | ) | const |
Definition at line 4633 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::p, and P.
Referenced by checkSymbolTable(), and getNValue().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1835 of file MachOObjectFile.cpp.
References getSymbolSection(), getSymbolTableEntryBase(), llvm::MachO::N_SECT, llvm::MachO::N_STAB, llvm::MachO::N_TYPE, llvm::MachO::N_UNDF, section_end(), llvm::object::SymbolRef::ST_Data, llvm::object::SymbolRef::ST_Debug, llvm::object::SymbolRef::ST_Function, llvm::object::SymbolRef::ST_Other, llvm::object::SymbolRef::ST_Unknown, and llvm::Expected< T >::takeError().
MachO::symtab_command MachOObjectFile::getSymtabLoadCommand | ( | ) | const |
Definition at line 4820 of file MachOObjectFile.cpp.
References llvm::MachO::symtab_command::cmd, llvm::MachO::symtab_command::cmdsize, llvm::MachO::symtab_command::nsyms, llvm::MachO::symtab_command::stroff, llvm::MachO::symtab_command::strsize, and llvm::MachO::symtab_command::symoff.
Referenced by checkSymbolTable(), getRelocationSymbol(), getStringTableData(), getSymbolByIndex(), getSymbolIndex(), symbol_begin(), and symbol_end().
MachO::thread_command MachOObjectFile::getThreadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4760 of file MachOObjectFile.cpp.
ArrayRef< uint8_t > MachOObjectFile::getUuid | ( | ) | const |
Definition at line 5269 of file MachOObjectFile.cpp.
MachO::uuid_command MachOObjectFile::getUuidCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4700 of file MachOObjectFile.cpp.
Definition at line 2849 of file MachOObjectFile.cpp.
Referenced by isValidArch().
MachO::version_min_command MachOObjectFile::getVersionMinLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4665 of file MachOObjectFile.cpp.
|
inlinestatic |
Definition at line 768 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
Definition at line 774 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
Definition at line 780 of file MachO.h.
References llvm::CallingConv::C.
|
inlinestatic |
|
static |
Definition at line 2419 of file MachOObjectFile.cpp.
References F, Idx, llvm::Lib, Name, llvm::StringRef::npos, llvm::StringRef::rfind(), llvm::StringRef::size(), and llvm::StringRef::slice().
Referenced by getLibraryShortNameByIndex().
|
inline |
Definition at line 761 of file MachO.h.
Referenced by llvm::object::BindRebaseSegInfo::BindRebaseSegInfo().
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 5282 of file MachOObjectFile.cpp.
References llvm::object::Binary::getMachOType(), and llvm::object::Binary::getType().
Referenced by bindTable(), checkDysymtabCommand(), checkSymbolTable(), checkSymtabCommand(), getBytesInAddress(), getFileFormatName(), getFirstLoadCommandInfo(), getHeader64(), getNextLoadCommandInfo(), getNValue(), getRelocation(), getRelocationSymbol(), getSectionAddress(), getSectionAlignment(), getSectionContents(), getSectionSize(), getSymbolByIndex(), getSymbolIndex(), isSectionStripped(), lazyBindTable(), moveSymbolNext(), llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection(), rebaseTable(), section_rel_end(), symbol_end(), and weakBindTable().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 2054 of file MachOObjectFile.cpp.
References llvm::consumeError(), llvm::Expected< T >::get(), getSectionName(), and llvm::Expected< T >::takeError().
Definition at line 5385 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::Triple::arm, llvm::MachO::ARM64_RELOC_SUBTRACTOR, llvm::MachO::ARM_RELOC_HALF, llvm::MachO::ARM_RELOC_HALF_SECTDIFF, llvm::MachO::ARM_RELOC_LOCAL_SECTDIFF, llvm::MachO::ARM_RELOC_SECTDIFF, llvm::MachO::GENERIC_RELOC_LOCAL_SECTDIFF, llvm::MachO::GENERIC_RELOC_SECTDIFF, llvm::Triple::thumb, llvm::Triple::x86, llvm::Triple::x86_64, and llvm::MachO::X86_64_RELOC_SUBTRACTOR.
|
overridevirtual |
True if this is a relocatable object (.o/.obj).
Implements llvm::object::ObjectFile.
Definition at line 5299 of file MachOObjectFile.cpp.
References llvm::MachO::mach_header::filetype, getHeader(), and llvm::MachO::MH_OBJECT.
Referenced by llvm::jitlink::MachOLinkGraphBuilder::buildGraph().
bool MachOObjectFile::isRelocationScattered | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4532 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_TYPE_X86_64, getCPUType(), getPlainRelocationAddress(), and llvm::MachO::R_SCATTERED.
Referenced by extractSections(), getAnyRelocationAddress(), getAnyRelocationLength(), getAnyRelocationPCRel(), getAnyRelocationSection(), getAnyRelocationType(), getRelocationSymbol(), isRelocScattered(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), llvm::RuntimeDyldMachOI386::processRelocationRef(), and llvm::RuntimeDyldMachOX86_64::processRelocationRef().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 2154 of file MachOObjectFile.cpp.
References getSectionFinalSegmentName(), and getSectionName().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2046 of file MachOObjectFile.cpp.
References Flags, getSectionFlags(), llvm::MachO::S_ATTR_PURE_INSTRUCTIONS, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2029 of file MachOObjectFile.cpp.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2038 of file MachOObjectFile.cpp.
References Flags, getSectionFlags(), llvm::MachO::S_ATTR_PURE_INSTRUCTIONS, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.
|
overridevirtual |
When dsymutil generates the companion file, it strips all unnecessary sections (e.g.
everything in the _TEXT segment) by omitting their body and setting the offset in their corresponding load command to zero.
While the load command itself is valid, reading the section corresponds to reading the number of bytes specified in the load command, starting from offset 0 (i.e. the Mach-O header at the beginning of the file).
Reimplemented from llvm::object::ObjectFile.
Definition at line 2161 of file MachOObjectFile.cpp.
References getSection(), getSection64(), is64Bit(), and llvm::MachO::section_64::offset.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2033 of file MachOObjectFile.cpp.
References Flags, getSectionFlags(), and llvm::MachO::S_ATTR_PURE_INSTRUCTIONS.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2147 of file MachOObjectFile.cpp.
References Flags, getSectionFlags(), llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.
Definition at line 2844 of file MachOObjectFile.cpp.
References getValidArchs(), and llvm::is_contained().
iterator_range< bind_iterator > MachOObjectFile::lazyBindTable | ( | Error & | Err | ) |
For use iterating over all lazy bind table entries.
Definition at line 4471 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoLazyBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Lazy.
iterator_range< MachOObjectFile::load_command_iterator > MachOObjectFile::load_commands | ( | ) | const |
Definition at line 4505 of file MachOObjectFile.cpp.
References begin_load_commands(), end_load_commands(), and llvm::make_range().
Referenced by getSegmentContents(), and llvm::object::MachOAbstractFixupEntry::MachOAbstractFixupEntry().
relocation_iterator MachOObjectFile::locrel_begin | ( | ) | const |
Definition at line 2208 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::RelocationRef.
relocation_iterator MachOObjectFile::locrel_end | ( | ) | const |
Definition at line 2216 of file MachOObjectFile.cpp.
References getDysymtabLoadCommand(), llvm::MachO::dysymtab_command::nlocrel, and llvm::object::ObjectFile::RelocationRef.
Maps a debug section name to a standard DWARF section name.
Reimplemented from llvm::object::ObjectFile.
Definition at line 5324 of file MachOObjectFile.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), and Name.
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 5374 of file MachOObjectFile.cpp.
References llvm::StringSwitch< T, R >::Default(), and llvm::binaryformat::unknown.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2225 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::b, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1925 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 1760 of file MachOObjectFile.cpp.
References is64Bit(), llvm::object::DataRefImpl::p, and llvm::XCOFF::SymbolTableEntrySize.
void MachOObjectFile::ReadULEB128s | ( | uint64_t | Index, |
SmallVectorImpl< uint64_t > & | Out | ||
) | const |
Definition at line 5287 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), llvm::DataExtractor::getULEB128(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by getFunctionStarts().
|
inline |
Definition at line 590 of file MachO.h.
Referenced by llvm::object::MachORebaseEntry::moveNext().
iterator_range< rebase_iterator > MachOObjectFile::rebaseTable | ( | Error & | Err | ) |
For use iterating over all rebase table entries.
Definition at line 3806 of file MachOObjectFile.cpp.
References getDyldInfoRebaseOpcodes(), is64Bit(), and rebaseTable().
Referenced by rebaseTable().
|
static |
For use examining rebase opcodes in a MachOObjectFile.
Definition at line 3793 of file MachOObjectFile.cpp.
References llvm::make_range().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2638 of file MachOObjectFile.cpp.
References llvm::object::ObjectFile::SectionRef.
Referenced by llvm::RuntimeDyldMachO::getSectionByAddress().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2643 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, llvm::object::ObjectFile::SectionRef, and llvm::SmallVectorBase< Size_T >::size().
Referenced by getAnyRelocationSection(), llvm::RuntimeDyldMachO::getSectionByAddress(), getSymbolSection(), getSymbolType(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2167 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and llvm::object::ObjectFile::RelocationRef.
Referenced by extractSections(), and section_rel_begin().
relocation_iterator MachOObjectFile::section_rel_begin | ( | unsigned | Index | ) | const |
Definition at line 2882 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and section_rel_begin().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2175 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getSection(), getSection64(), is64Bit(), llvm::MachO::section::nreloc, llvm::MachO::section_64::nreloc, and llvm::object::ObjectFile::RelocationRef.
Referenced by extractSections(), and section_rel_end().
relocation_iterator MachOObjectFile::section_rel_end | ( | unsigned | Index | ) | const |
Definition at line 2888 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and section_rel_end().
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 2590 of file MachOObjectFile.cpp.
References getSymbolByIndex(), getSymtabLoadCommand(), llvm::MachO::symtab_command::nsyms, and llvm::object::ObjectFile::SymbolRef.
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 2599 of file MachOObjectFile.cpp.
References getPtr(), getSymtabLoadCommand(), is64Bit(), llvm::MachO::symtab_command::nsyms, llvm::Offset, llvm::object::DataRefImpl::p, llvm::object::ObjectFile::SymbolRef, llvm::XCOFF::SymbolTableEntrySize, and llvm::MachO::symtab_command::symoff.
Referenced by getRelocationSymbol().
iterator_range< bind_iterator > MachOObjectFile::weakBindTable | ( | Error & | Err | ) |
For use iterating over all weak bind table entries.
Definition at line 4476 of file MachOObjectFile.cpp.
References bindTable(), getDyldInfoWeakBindOpcodes(), is64Bit(), and llvm::object::MachOBindEntry::Weak.
MachO::mach_header llvm::object::MachOObjectFile::Header |
Definition at line 846 of file MachO.h.
Referenced by getArchTriple(), getChainedFixupsSegments(), getDyldChainedFixupTargets(), and getHeader().
MachO::mach_header_64 llvm::object::MachOObjectFile::Header64 |
Definition at line 845 of file MachO.h.
Referenced by getHeader64().