LLVM: lib/ObjCopy/MachO/MachOReader.cpp File Reference (original) (raw)
#include "[MachOReader.h](MachOReader%5F8h%5Fsource.html)"#include "[MachOObject.h](MachOObject%5F8h%5Fsource.html)"#include "[llvm/BinaryFormat/MachO.h](BinaryFormat%5F2MachO%5F8h%5Fsource.html)"#include "[llvm/Object/MachO.h](Object%5F2MachO%5F8h%5Fsource.html)"#include <memory>#include "llvm/BinaryFormat/MachO.def"
Go to the source code of this file.
| Macros | |
|---|---|
| #define | HANDLE_LOAD_COMMAND(LCName, LCValue, LCStruct) |
| Functions | |
|---|---|
| template | |
| static Section | constructSectionCommon (const SectionType &Sec, uint32_t Index) |
| Section | constructSection (const MachO::section &Sec, uint32_t Index) |
| Section | constructSection (const MachO::section_64 &Sec, uint32_t Index) |
| template<typename SectionType, typename SegmentType> | |
| static Expected< std::vector< std::unique_ptr< Section > > > | extractSections (const object::MachOObjectFile::LoadCommandInfo &LoadCmd, const object::MachOObjectFile &MachOObj, uint32_t &NextSectionIndex) |
| template<typename nlist_t> | |
| SymbolEntry | constructSymbolEntry (StringRef StrTable, const nlist_t &nlist) |
◆ HANDLE_LOAD_COMMAND
| #define HANDLE_LOAD_COMMAND | ( | LCName, |
|---|---|---|
| LCValue, | ||
| LCStruct ) |
Value:
case MachO::LCName: \
memcpy((void *)&(LC.MachOLoadCommand.LCStruct##_data), LoadCmd.Ptr, \
sizeof(MachO::LCStruct)); \
MachO::swapStruct(LC.MachOLoadCommand.LCStruct##_data); \
if (LoadCmd.C.cmdsize > sizeof(MachO::LCStruct)) \
reinterpret_cast<uint8_t *>(const_cast<char *>(LoadCmd.Ptr)) + \
sizeof(MachO::LCStruct), \
LoadCmd.C.cmdsize - sizeof(MachO::LCStruct)); \
break;
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
constexpr bool IsLittleEndianHost
◆ constructSection() [1/2]
◆ constructSection() [2/2]
◆ constructSectionCommon()
template
Definition at line 30 of file MachOReader.cpp.
References llvm::objcopy::macho::Section::Addr, llvm::objcopy::macho::Section::Align, llvm::objcopy::macho::Section::Flags, llvm::objcopy::macho::Section::Index, llvm::objcopy::macho::Section::NReloc, llvm::objcopy::macho::Section::OriginalOffset, llvm::objcopy::macho::Section::RelOff, llvm::objcopy::macho::Section::Reserved1, llvm::objcopy::macho::Section::Reserved2, llvm::objcopy::macho::Section::Reserved3, llvm::objcopy::macho::Section::Size, and strnlen().
Referenced by constructSection(), and constructSection().
◆ constructSymbolEntry()
template<typename nlist_t>
◆ extractSections()
template<typename SectionType, typename SegmentType>
Definition at line 59 of file MachOReader.cpp.
References llvm::MachO::ARM64_RELOC_ADDEND, assert(), llvm::object::MachOObjectFile::LoadCommandInfo::C, llvm::MachO::load_command::cmdsize, constructSection(), llvm::objcopy::macho::Section::Content, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::mach_header::cputype, llvm::Data, llvm::object::MachOObjectFile::getAnyRelocationType(), llvm::object::MachOObjectFile::getHeader(), llvm::object::MachOObjectFile::getPlainRelocationExternal(), llvm::object::MachOObjectFile::getRelocation(), llvm::object::MachOObjectFile::getSection(), llvm::object::MachOObjectFile::getSectionContents(), llvm::object::Binary::isLittleEndian(), llvm::sys::IsLittleEndianHost, llvm::object::MachOObjectFile::isRelocationScattered(), llvm::objcopy::macho::Section::NReloc, llvm::object::MachOObjectFile::LoadCommandInfo::Ptr, llvm::objcopy::macho::Section::Relocations, llvm::object::MachOObjectFile::section_rel_begin(), llvm::object::MachOObjectFile::section_rel_end(), llvm::MachO::swapStruct(), and llvm::Expected< T >::takeError().