LLVM
8.0.1
|
#include "llvm/Object/MachO.h"
Classes | |
struct | LoadCommandInfo |
Public Types | |
using | LoadCommandList = SmallVector< LoadCommandInfo, 4 > |
using | load_command_iterator = LoadCommandList::const_iterator |
Public Types inherited from llvm::object::ObjectFile | |
using | symbol_iterator_range = iterator_range< symbol_iterator > |
using | section_iterator_range = iterator_range< section_iterator > |
Public Types inherited from llvm::object::SymbolicFile | |
using | basic_symbol_iterator_range = iterator_range< basic_symbol_iterator > |
dice_iterator MachOObjectFile::begin_dices | ( | ) | const |
Definition at line 2691 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, getPtr(), and llvm::object::DataRefImpl::p.
MachOObjectFile::load_command_iterator MachOObjectFile::begin_load_commands | ( | ) | const |
Definition at line 4115 of file MachOObjectFile.cpp.
|
inline |
For use in MachOBindEntry::moveNext() to validate a MachOBindEntry for the BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB opcode.
Definition at line 425 of file MachO.h.
Referenced by llvm::object::MachOBindEntry::moveNext().
|
inline |
For use with a SegIndex,SegOffset pair in MachOBindEntry::moveNext() to validate a MachOBindEntry.
Definition at line 418 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 462 of file MachO.h.
References llvm::object::getSection(), is64Bit(), and Name.
Referenced by llvm::object::MachORebaseEntry::address(), and llvm::object::MachOBindEntry::address().
|
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 456 of file MachO.h.
Referenced by llvm::object::MachORebaseEntry::sectionName(), and llvm::object::MachOBindEntry::sectionName().
|
inline |
For use with the SegIndex of a checked Mach-O Bind or Rebase entry to get the segment name.
Definition at line 450 of file MachO.h.
Referenced by llvm::object::MachORebaseEntry::segmentName(), and llvm::object::MachOBindEntry::segmentName().
iterator_range< bind_iterator > MachOObjectFile::bindTable | ( | Error & | Err | ) |
For use iterating over all bind table entries.
Definition at line 4099 of file MachOObjectFile.cpp.
References is64Bit(), and llvm::object::MachOBindEntry::Regular.
Referenced by llvm::object::BindRebaseSegInfo::address().
|
static |
For use examining bind opcodes in a MachOObjectFile.
Error MachOObjectFile::checkSymbolTable | ( | ) | const |
Definition at line 1633 of file MachOObjectFile.cpp.
References llvm::MachO::DYNAMIC_LOOKUP_ORDINAL, llvm::MachO::EXECUTABLE_ORDINAL, llvm::MachO::mach_header::flags, llvm::MachO::mach_header_64::flags, llvm::MachO::GET_LIBRARY_ORDINAL(), getHeader(), getHeader64(), 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::MachO::symtab_command::strsize, llvm::Error::success(), and llvm::ARMBuildAttrs::Symbol.
Definition at line 590 of file MachO.h.
References llvm::object::Binary::isMachO().
|
static |
Definition at line 1200 of file MachOObjectFile.cpp.
Referenced by llvm::object::ObjectFile::createMachOObjectFile().
dice_iterator MachOObjectFile::end_dices | ( | ) | const |
Definition at line 2701 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::dataoff, llvm::MachO::linkedit_data_command::datasize, getPtr(), and llvm::object::DataRefImpl::p.
MachOObjectFile::load_command_iterator MachOObjectFile::end_load_commands | ( | ) | const |
Definition at line 4120 of file MachOObjectFile.cpp.
iterator_range< export_iterator > MachOObjectFile::exports | ( | Error & | Err | ) | const |
For use iterating over all exported symbols.
Definition at line 3030 of file MachOObjectFile.cpp.
Referenced by llvm::object::ExportEntry::moveNext().
|
static |
For use examining a trie not in a MachOObjectFile.
|
inline |
Definition at line 330 of file MachO.h.
References llvm::make_range().
relocation_iterator MachOObjectFile::extrel_begin | ( | ) | const |
Definition at line 2037 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, and llvm::MipsISD::Ret.
relocation_iterator MachOObjectFile::extrel_end | ( | ) | const |
Definition at line 2045 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, llvm::MachO::dysymtab_command::nextrel, and llvm::MipsISD::Ret.
unsigned MachOObjectFile::getAnyRelocationAddress | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4188 of file MachOObjectFile.cpp.
References getPlainRelocationAddress(), and getScatteredRelocationAddress().
Referenced by llvm::RuntimeDyldMachOARM::finalizeSection().
unsigned MachOObjectFile::getAnyRelocationLength | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4202 of file MachOObjectFile.cpp.
References getPlainRelocationLength(), and getScatteredRelocationLength().
Referenced by llvm::RuntimeDyldMachOX86_64::finalizeSection(), llvm::RuntimeDyldMachOI386::finalizeSection(), llvm::RuntimeDyldMachOARM::finalizeSection(), llvm::RuntimeDyldMachOAArch64::finalizeSection(), llvm::RuntimeDyldMachO::getRelocationEntry(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
unsigned MachOObjectFile::getAnyRelocationPCRel | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4195 of file MachOObjectFile.cpp.
References getPlainRelocationPCRel(), and getScatteredRelocationPCRel().
Referenced by llvm::RuntimeDyldMachOI386::finalizeSection(), llvm::RuntimeDyldMachOARM::finalizeSection(), llvm::RuntimeDyldMachO::getRelocationEntry(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
SectionRef MachOObjectFile::getAnyRelocationSection | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4218 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and llvm::MachO::R_ABS.
Referenced by llvm::RuntimeDyldMachOX86_64::finalizeSection(), and llvm::RuntimeDyldMachO::getRelocationValueRef().
unsigned MachOObjectFile::getAnyRelocationType | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4210 of file MachOObjectFile.cpp.
References getPlainRelocationType().
Referenced by llvm::RuntimeDyldMachOI386::finalizeSection(), llvm::RuntimeDyldMachOARM::finalizeSection(), llvm::RuntimeDyldMachO::getRelocationEntry(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Referenced by isValidArch().
|
static |
Definition at line 2507 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::Triple::arm, llvm::MachO::CPU_SUBTYPE_ARM64_ALL, 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_I386, llvm::MachO::CPU_TYPE_POWERPC, llvm::MachO::CPU_TYPE_POWERPC64, llvm::MachO::CPU_TYPE_X86_64, getArchTriple(), llvm::Triple::ppc, llvm::Triple::ppc64, llvm::Triple::UnknownArch, llvm::Triple::x86, and llvm::Triple::x86_64.
Referenced by getArch(), llvm::object::MachOUniversalBinary::ObjectForArch::getArchFlagName(), and isValidArch().
|
static |
|
inlinestatic |
Definition at line 612 of file MachO.h.
References llvm::format_hex(), llvm::MachO::PLATFORM_BRIDGEOS, llvm::MachO::PLATFORM_IOS, llvm::MachO::PLATFORM_IOSSIMULATOR, 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 630 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 4300 of file MachOObjectFile.cpp.
MachO::build_version_command MachOObjectFile::getBuildVersionLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4295 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
|
overridevirtual |
The number of bytes used to represent an address in this object file format.
Implements llvm::object::ObjectFile.
Definition at line 2476 of file MachOObjectFile.cpp.
References is64Bit().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1771 of file MachOObjectFile.cpp.
MachO::linkedit_data_command MachOObjectFile::getDataInCodeLoadCommand | ( | ) | const |
Definition at line 4485 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::cmd.
MachO::data_in_code_entry MachOObjectFile::getDataInCodeTableEntry | ( | uint32_t | DataOffset, |
unsigned | Index | ||
) | const |
Definition at line 4434 of file MachOObjectFile.cpp.
References getPtr().
MachO::data_in_code_entry MachOObjectFile::getDice | ( | DataRefImpl | Rel | ) | const |
Definition at line 4412 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 4524 of file MachOObjectFile.cpp.
References llvm::MachO::dyld_info_command::bind_off, llvm::MachO::dyld_info_command::bind_size, getPtr(), llvm::makeArrayRef(), and None.
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoExportsTrie | ( | ) | const |
Definition at line 4557 of file MachOObjectFile.cpp.
References llvm::MachO::dyld_info_command::export_off, llvm::MachO::dyld_info_command::export_size, getPtr(), llvm::makeArrayRef(), and None.
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoLazyBindOpcodes | ( | ) | const |
Definition at line 4546 of file MachOObjectFile.cpp.
References getPtr(), llvm::MachO::dyld_info_command::lazy_bind_off, llvm::MachO::dyld_info_command::lazy_bind_size, llvm::makeArrayRef(), and None.
MachO::dyld_info_command MachOObjectFile::getDyldInfoLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4310 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoRebaseOpcodes | ( | ) | const |
Definition at line 4513 of file MachOObjectFile.cpp.
References getPtr(), llvm::makeArrayRef(), None, llvm::MachO::dyld_info_command::rebase_off, and llvm::MachO::dyld_info_command::rebase_size.
ArrayRef< uint8_t > MachOObjectFile::getDyldInfoWeakBindOpcodes | ( | ) | const |
Definition at line 4535 of file MachOObjectFile.cpp.
References getPtr(), llvm::makeArrayRef(), None, llvm::MachO::dyld_info_command::weak_bind_off, and llvm::MachO::dyld_info_command::weak_bind_size.
MachO::dylib_command MachOObjectFile::getDylibIDLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4305 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::dylinker_command MachOObjectFile::getDylinkerCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4315 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::dysymtab_command MachOObjectFile::getDysymtabLoadCommand | ( | ) | const |
Definition at line 4455 of file MachOObjectFile.cpp.
References llvm::MachO::dysymtab_command::cmd.
Referenced by llvm::RuntimeDyldMachOI386::finalizeSection(), and llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
MachO::encryption_info_command MachOObjectFile::getEncryptionInfoCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4340 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::encryption_info_command_64 MachOObjectFile::getEncryptionInfoCommand64 | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4345 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::entry_point_command MachOObjectFile::getEntryPointCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4335 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
|
inlineoverridevirtual |
Implements llvm::object::ObjectFile.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2480 of file MachOObjectFile.cpp.
References 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().
const MachO::mach_header & MachOObjectFile::getHeader | ( | ) | const |
Definition at line 4417 of file MachOObjectFile.cpp.
Referenced by checkSymbolTable().
const MachO::mach_header_64 & MachOObjectFile::getHeader64 | ( | ) | const |
Definition at line 4421 of file MachOObjectFile.cpp.
References assert(), and is64Bit().
Referenced by checkSymbolTable().
|
static |
Definition at line 2646 of file MachOObjectFile.cpp.
References llvm::sys::getDefaultTargetTriple().
std::error_code MachOObjectFile::getIndirectName | ( | DataRefImpl | Symb, |
StringRef & | Res | ||
) | const |
Definition at line 1740 of file MachOObjectFile.cpp.
References getSymbolTableEntryBase(), llvm::MachO::N_INDR, llvm::MachO::N_TYPE, llvm::MachO::nlist_base::n_type, llvm::object::parse_failed, and llvm::StringRef::size().
uint32_t MachOObjectFile::getIndirectSymbolTableEntry | ( | const MachO::dysymtab_command & | DLC, |
unsigned | Index | ||
) | const |
Definition at line 4426 of file MachOObjectFile.cpp.
References getPtr(), and llvm::MachO::dysymtab_command::indirectsymoff.
Referenced by llvm::RuntimeDyldMachOI386::finalizeSection(), and llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
uint32_t MachOObjectFile::getLibraryCount | ( | ) | const |
Definition at line 2406 of file MachOObjectFile.cpp.
Referenced by llvm::object::MachOBindEntry::moveNext().
std::error_code MachOObjectFile::getLibraryShortNameByIndex | ( | unsigned | Index, |
StringRef & | Res | ||
) | const |
Definition at line 2375 of file MachOObjectFile.cpp.
References llvm::MachO::dylib_command::cmdsize, D, llvm::MachO::dylib_command::dylib, llvm::StringRef::empty(), Name, llvm::MachO::dylib::name, P, llvm::object::parse_failed, and llvm::StringRef::size().
MachO::linkedit_data_command MachOObjectFile::getLinkeditDataLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4265 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::linker_option_command MachOObjectFile::getLinkerOptionLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4280 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::linkedit_data_command MachOObjectFile::getLinkOptHintsLoadCommand | ( | ) | const |
Definition at line 4499 of file MachOObjectFile.cpp.
References llvm::MachO::linkedit_data_command::cmd.
MachO::note_command MachOObjectFile::getNoteLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4290 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
uint64_t MachOObjectFile::getNValue | ( | DataRefImpl | Sym | ) | const |
Definition at line 1729 of file MachOObjectFile.cpp.
References is64Bit(), llvm::MachO::nlist::n_value, and llvm::MachO::nlist_64::n_value.
bool MachOObjectFile::getPlainRelocationExternal | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4166 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word1.
Referenced by llvm::RuntimeDyldMachOX86_64::finalizeSection(), llvm::RuntimeDyldMachO::getRelocationValueRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
unsigned MachOObjectFile::getPlainRelocationSymbolNum | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4159 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word1.
Referenced by llvm::RuntimeDyldMachOAArch64::processRelocationRef().
MachO::any_relocation_info MachOObjectFile::getRelocation | ( | DataRefImpl | Rel | ) | const |
Definition at line 4385 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, llvm::MachO::dysymtab_command::extreloff, getPtr(), llvm::object::getSection(), is64Bit(), llvm::MachO::dysymtab_command::locreloff, llvm::MachO::MH_OBJECT, P, llvm::MachO::section::reloff, and llvm::MachO::section_64::reloff.
Referenced by llvm::RuntimeDyldMachOX86_64::finalizeSection(), llvm::RuntimeDyldMachOI386::finalizeSection(), llvm::RuntimeDyldMachOARM::finalizeSection(), llvm::RuntimeDyldMachOAArch64::finalizeSection(), llvm::RuntimeDyldMachO::getRelocationEntry(), llvm::RuntimeDyldMachO::getRelocationValueRef(), llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), llvm::RuntimeDyldMachOAArch64::processRelocationRef(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
uint8_t MachOObjectFile::getRelocationLength | ( | DataRefImpl | Rel | ) | const |
Definition at line 2223 of file MachOObjectFile.cpp.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2075 of file MachOObjectFile.cpp.
References assert(), llvm::MachO::MH_KEXT_BUNDLE, and llvm::MachO::MH_OBJECT.
section_iterator MachOObjectFile::getRelocationRelocatedSection | ( | relocation_iterator | Rel | ) | const |
Definition at line 2411 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
section_iterator MachOObjectFile::getRelocationSection | ( | DataRefImpl | Rel | ) | const |
Definition at line 2105 of file MachOObjectFile.cpp.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2084 of file MachOObjectFile.cpp.
References getPtr(), is64Bit(), llvm::object::DataRefImpl::p, and llvm::MachO::symtab_command::symoff.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2109 of file MachOObjectFile.cpp.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2114 of file MachOObjectFile.cpp.
References llvm::Triple::aarch64, llvm::SmallVectorImpl< T >::append(), llvm::Triple::arm, llvm::array_lengthof(), llvm::StringRef::begin(), llvm::StringRef::end(), 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 4370 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::routines_command_64 MachOObjectFile::getRoutinesCommand64 | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4375 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::rpath_command MachOObjectFile::getRpathCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4325 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
bool MachOObjectFile::getScatteredRelocationScattered | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4173 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 4183 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 4178 of file MachOObjectFile.cpp.
References llvm::MachO::any_relocation_info::r_word1.
Referenced by llvm::RuntimeDyldMachOI386::finalizeSection(), llvm::RuntimeDyldMachOARM::finalizeSection(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
Expected< SectionRef > MachOObjectFile::getSection | ( | unsigned | SectionIndex | ) | const |
Definition at line 1942 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, and malformedError().
Referenced by llvm::RuntimeDyldMachOI386::finalizeSection(), and llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
Expected< SectionRef > MachOObjectFile::getSection | ( | StringRef | SectionName | ) | const |
Definition at line 1951 of file MachOObjectFile.cpp.
References E, llvm::errorCodeToError(), llvm::object::parse_failed, and llvm::ARMBuildAttrs::Section.
MachO::section MachOObjectFile::getSection | ( | DataRefImpl | DRI | ) | const |
Definition at line 4230 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), and llvm::object::DataRefImpl::d.
MachO::section MachOObjectFile::getSection | ( | const LoadCommandInfo & | L, |
unsigned | Index | ||
) | const |
Definition at line 4240 of file MachOObjectFile.cpp.
References getSectionPtr().
MachO::section_64 MachOObjectFile::getSection64 | ( | DataRefImpl | DRI | ) | const |
Definition at line 4235 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), and llvm::object::DataRefImpl::d.
MachO::section_64 MachOObjectFile::getSection64 | ( | const LoadCommandInfo & | L, |
unsigned | Index | ||
) | const |
Definition at line 4246 of file MachOObjectFile.cpp.
References getSectionPtr().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1871 of file MachOObjectFile.cpp.
References llvm::object::getSection(), and is64Bit().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1929 of file MachOObjectFile.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::MachO::section::align, llvm::MachO::section_64::align, llvm::object::getSection(), and is64Bit().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1910 of file MachOObjectFile.cpp.
References llvm::object::getSection(), is64Bit(), llvm::MachO::section::offset, llvm::MachO::section_64::offset, Size, llvm::MachO::section::size, llvm::MachO::section_64::size, and llvm::StringRef::substr().
StringRef MachOObjectFile::getSectionFinalSegmentName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4130 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), and parseSegmentOrSectionName().
Referenced by llvm::object::BindRebaseSegInfo::BindRebaseSegInfo().
unsigned MachOObjectFile::getSectionID | ( | SectionRef | Sec | ) | const |
Definition at line 1988 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 1877 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1864 of file MachOObjectFile.cpp.
References llvm::ArrayRef< T >::data(), and parseSegmentOrSectionName().
ArrayRef< char > MachOObjectFile::getSectionRawFinalSegmentName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4144 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), llvm::object::DataRefImpl::d, and llvm::makeArrayRef().
ArrayRef< char > MachOObjectFile::getSectionRawName | ( | DataRefImpl | Sec | ) | const |
Definition at line 4136 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, assert(), llvm::object::DataRefImpl::d, and llvm::makeArrayRef().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1881 of file MachOObjectFile.cpp.
References llvm::MachO::section::flags, llvm::MachO::section_64::flags, llvm::object::getSection(), is64Bit(), llvm::MachO::section::offset, llvm::MachO::section_64::offset, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, llvm::MachO::SECTION_TYPE, llvm::MachO::section::size, and llvm::MachO::section_64::size.
unsigned MachOObjectFile::getSectionType | ( | SectionRef | Sec | ) | const |
Definition at line 1723 of file MachOObjectFile.cpp.
References llvm::object::SectionRef::getRawDataRefImpl(), getSectionFlags(), and llvm::MachO::SECTION_TYPE.
MachO::segment_command_64 MachOObjectFile::getSegment64LoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4275 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::segment_command MachOObjectFile::getSegmentLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4270 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::source_version_command MachOObjectFile::getSourceVersionCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4330 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
StringRef MachOObjectFile::getStringTableData | ( | ) | const |
Definition at line 4576 of file MachOObjectFile.cpp.
References llvm::MachO::symtab_command::stroff, and llvm::MachO::symtab_command::strsize.
MachO::sub_client_command MachOObjectFile::getSubClientCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4365 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::sub_framework_command MachOObjectFile::getSubFrameworkCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4350 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::sub_library_command MachOObjectFile::getSubLibraryCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4360 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::sub_umbrella_command MachOObjectFile::getSubUmbrellaCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4355 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::nlist_64 MachOObjectFile::getSymbol64TableEntry | ( | DataRefImpl | DRI | ) | const |
Definition at line 4259 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::p, and P.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1758 of file MachOObjectFile.cpp.
References getSymbolValue().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 1762 of file MachOObjectFile.cpp.
References llvm::MachO::GET_COMM_ALIGN(), getSymbolTableEntryBase(), llvm::MachO::nlist_base::n_desc, and llvm::object::BasicSymbolRef::SF_Common.
symbol_iterator MachOObjectFile::getSymbolByIndex | ( | unsigned | Index | ) | const |
Definition at line 2441 of file MachOObjectFile.cpp.
References getPtr(), is64Bit(), llvm::MachO::symtab_command::nsyms, llvm::object::DataRefImpl::p, llvm::report_fatal_error(), and llvm::MachO::symtab_command::symoff.
Referenced by llvm::RuntimeDyldMachOI386::finalizeSection(), and llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 1799 of file MachOObjectFile.cpp.
References 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_PEXT, 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_Exported, 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, and llvm::object::BasicSymbolRef::SF_Weak.
uint64_t MachOObjectFile::getSymbolIndex | ( | DataRefImpl | Symb | ) | const |
Definition at line 2453 of file MachOObjectFile.cpp.
References getPtr(), is64Bit(), llvm::object::DataRefImpl::p, llvm::report_fatal_error(), and llvm::MachO::symtab_command::symoff.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1708 of file MachOObjectFile.cpp.
References getSymbolTableEntryBase(), and llvm::MachO::nlist_base::n_strx.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1839 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::d, getSymbolTableEntryBase(), malformedError(), and llvm::MachO::nlist_base::n_sect.
Definition at line 1854 of file MachOObjectFile.cpp.
References llvm::object::BasicSymbolRef::getRawDataRefImpl(), getSymbolTableEntryBase(), and llvm::MachO::nlist_base::n_sect.
MachO::nlist MachOObjectFile::getSymbolTableEntry | ( | DataRefImpl | DRI | ) | const |
Definition at line 4253 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::p, and P.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1776 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_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 4440 of file MachOObjectFile.cpp.
References llvm::MachO::symtab_command::cmd.
MachO::thread_command MachOObjectFile::getThreadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4380 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
ArrayRef< uint8_t > MachOObjectFile::getUuid | ( | ) | const |
Definition at line 4568 of file MachOObjectFile.cpp.
References llvm::makeArrayRef(), None, and offsetof.
Referenced by llvm::symbolize::LLVMSymbolizer::flush().
MachO::uuid_command MachOObjectFile::getUuidCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4320 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
MachO::version_min_command MachOObjectFile::getVersionMinLoadCommand | ( | const LoadCommandInfo & | L | ) | const |
Definition at line 4285 of file MachOObjectFile.cpp.
References llvm::object::MachOObjectFile::LoadCommandInfo::Ptr.
|
inlinestatic |
Definition at line 595 of file MachO.h.
References llvm::MachO::version_min_command::sdk, and llvm::MachO::version_min_command::version.
|
inlinestatic |
Definition at line 601 of file MachO.h.
References llvm::MachO::version_min_command::sdk, and llvm::MachO::version_min_command::version.
|
inlinestatic |
Definition at line 607 of file MachO.h.
References llvm::MachO::version_min_command::sdk, and llvm::MachO::version_min_command::version.
|
inlinestatic |
Definition at line 643 of file MachO.h.
References llvm::SmallString< InternalLen >::str(), llvm::utostr(), and llvm::IndexedInstrProf::Version.
|
static |
Definition at line 2256 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().
|
inline |
Definition at line 588 of file MachO.h.
Referenced by llvm::object::BindRebaseSegInfo::BindRebaseSegInfo().
bool MachOObjectFile::is64Bit | ( | ) | const |
Definition at line 4581 of file MachOObjectFile.cpp.
References getType().
Referenced by llvm::RuntimeDyldMachO::populateIndirectSymbolPointersSection().
|
overridevirtual |
True if this is a relocatable object (.o/.obj).
Implements llvm::object::ObjectFile.
Definition at line 4598 of file MachOObjectFile.cpp.
References llvm::MachO::MH_OBJECT.
bool MachOObjectFile::isRelocationScattered | ( | const MachO::any_relocation_info & | RE | ) | const |
Definition at line 4152 of file MachOObjectFile.cpp.
References llvm::MachO::CPU_TYPE_X86_64, getCPUType(), getPlainRelocationAddress(), and llvm::MachO::R_SCATTERED.
Referenced by llvm::RuntimeDyldMachOI386::processRelocationRef(), llvm::RuntimeDyldMachOX86_64::processRelocationRef(), llvm::RuntimeDyldMachOARM::processRelocationRef(), and llvm::RuntimeDyldMachOAArch64::processRelocationRef().
|
overridevirtual |
Reimplemented from llvm::object::ObjectFile.
Definition at line 1999 of file MachOObjectFile.cpp.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1980 of file MachOObjectFile.cpp.
References 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 1963 of file MachOObjectFile.cpp.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1972 of file MachOObjectFile.cpp.
References 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 2007 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, llvm::object::getSection(), is64Bit(), llvm::MachO::section::nreloc, llvm::MachO::section_64::nreloc, llvm::MipsISD::Ret, section_rel_begin(), and section_rel_end().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1967 of file MachOObjectFile.cpp.
References getSectionFlags(), and llvm::MachO::S_ATTR_PURE_INSTRUCTIONS.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1992 of file MachOObjectFile.cpp.
References getSectionFlags(), llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, and llvm::MachO::SECTION_TYPE.
Definition at line 2650 of file MachOObjectFile.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), getArch(), getArchTriple(), and getCPUType().
iterator_range< bind_iterator > MachOObjectFile::lazyBindTable | ( | Error & | Err | ) |
For use iterating over all lazy bind table entries.
Definition at line 4104 of file MachOObjectFile.cpp.
References is64Bit(), and llvm::object::MachOBindEntry::Lazy.
iterator_range< MachOObjectFile::load_command_iterator > MachOObjectFile::load_commands | ( | ) | const |
Definition at line 4125 of file MachOObjectFile.cpp.
References llvm::make_range().
relocation_iterator MachOObjectFile::locrel_begin | ( | ) | const |
Definition at line 2054 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, and llvm::MipsISD::Ret.
relocation_iterator MachOObjectFile::locrel_end | ( | ) | const |
Definition at line 2062 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, llvm::object::DataRefImpl::b, llvm::object::DataRefImpl::d, llvm::MachO::dysymtab_command::nlocrel, and llvm::MipsISD::Ret.
Maps a debug section name to a standard DWARF section name.
Reimplemented from llvm::object::ObjectFile.
Definition at line 4623 of file MachOObjectFile.cpp.
References llvm::StringSwitch< T, R >::Default(), and Name.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2071 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::b, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 1860 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 1701 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 4586 of file MachOObjectFile.cpp.
References llvm::object::Binary::getData(), llvm::DataExtractor::getULEB128(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
inline |
For use in MachORebaseEntry::moveNext() to validate a MachORebaseEntry for the REBASE_OPCODE_DO_*_TIMES* opcodes.
Definition at line 441 of file MachO.h.
Referenced by llvm::object::MachORebaseEntry::moveNext().
|
inline |
For use with a SegIndex,SegOffset pair in MachORebaseEntry::moveNext() to validate a MachORebaseEntry.
Definition at line 434 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 3415 of file MachOObjectFile.cpp.
References is64Bit().
|
static |
For use examining rebase opcodes in a MachOObjectFile.
Definition at line 3402 of file MachOObjectFile.cpp.
References llvm::RISCVFenceField::O.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2465 of file MachOObjectFile.cpp.
Referenced by llvm::RuntimeDyldMachO::getSectionByAddress().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Definition at line 2470 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
Referenced by llvm::RuntimeDyldMachOI386::finalizeSection(), llvm::RuntimeDyldMachOARM::finalizeSection(), llvm::RuntimeDyldMachO::getSectionByAddress(), and llvm::RuntimeDyldMachO::processScatteredVANILLA().
|
overridevirtual |
Implements llvm::object::ObjectFile.
Referenced by isSectionStripped().
relocation_iterator MachOObjectFile::section_rel_begin | ( | unsigned | Index | ) | const |
Definition at line 2679 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::ObjectFile.
Referenced by isSectionStripped().
relocation_iterator MachOObjectFile::section_rel_end | ( | unsigned | Index | ) | const |
Definition at line 2685 of file MachOObjectFile.cpp.
References llvm::object::DataRefImpl::a, and llvm::object::DataRefImpl::d.
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 2417 of file MachOObjectFile.cpp.
References llvm::MachO::symtab_command::nsyms.
|
overridevirtual |
Implements llvm::object::SymbolicFile.
Definition at line 2426 of file MachOObjectFile.cpp.
References getPtr(), is64Bit(), llvm::MachO::symtab_command::nsyms, llvm::object::DataRefImpl::p, and llvm::MachO::symtab_command::symoff.
iterator_range< bind_iterator > MachOObjectFile::weakBindTable | ( | Error & | Err | ) |
For use iterating over all weak bind table entries.
Definition at line 4109 of file MachOObjectFile.cpp.
References is64Bit(), and llvm::object::MachOBindEntry::Weak.
MachO::mach_header llvm::object::MachOObjectFile::Header |
MachO::mach_header_64 llvm::object::MachOObjectFile::Header64 |