LLVM 20.0.0git
|
#include "llvm/Object/Binary.h"
Public Member Functions | |
Binary ()=delete | |
Binary (const Binary &other)=delete | |
virtual | ~Binary () |
virtual Error | initContent () |
StringRef | getData () const |
StringRef | getFileName () const |
MemoryBufferRef | getMemoryBufferRef () const |
unsigned int | getType () const |
bool | isObject () const |
bool | isSymbolic () const |
bool | isArchive () const |
bool | isMachOUniversalBinary () const |
bool | isTapiUniversal () const |
bool | isELF () const |
bool | isMachO () const |
bool | isCOFF () const |
bool | isXCOFF () const |
bool | isWasm () const |
bool | isOffloadFile () const |
bool | isCOFFImportFile () const |
bool | isIR () const |
bool | isGOFF () const |
bool | isMinidump () const |
bool | isTapiFile () const |
bool | isLittleEndian () const |
bool | isWinRes () const |
Triple::ObjectFormatType | getTripleObjectFormat () const |
Static Public Member Functions | |
static Error | checkOffset (MemoryBufferRef M, uintptr_t Addr, const uint64_t Size) |
Protected Types | |
enum | { ID_Archive , ID_MachOUniversalBinary , ID_COFFImportFile , ID_IR , ID_TapiUniversal , ID_TapiFile , ID_Minidump , ID_WinRes , ID_Offload , ID_StartObjects , ID_COFF , ID_XCOFF32 , ID_XCOFF64 , ID_ELF32L , ID_ELF32B , ID_ELF64L , ID_ELF64B , ID_MachO32L , ID_MachO32B , ID_MachO64L , ID_MachO64B , ID_GOFF , ID_Wasm , ID_EndObjects } |
Protected Member Functions | |
Binary (unsigned int Type, MemoryBufferRef Source) | |
Static Protected Member Functions | |
static unsigned int | getELFType (bool isLE, bool is64Bits) |
static unsigned int | getMachOType (bool isLE, bool is64Bits) |
Protected Attributes | |
MemoryBufferRef | Data |
|
protected |
|
protected |
Definition at line 36 of file Binary.cpp.
|
delete |
|
virtualdefault |
|
inlinestatic |
Definition at line 175 of file Binary.h.
References Addr, llvm::errorCodeToError(), Size, llvm::Error::success(), and llvm::object::unexpected_eof.
Referenced by getFirstReloc(), getObject(), llvm::object::getObject(), llvm::object::XCOFFObjectFile::getRawData(), llvm::object::COFFObjectFile::getSectionContents(), llvm::object::XCOFFObjectFile::getSectionContents(), and llvm::object::XCOFFObjectFile::getSectionFileOffsetToRawData().
StringRef Binary::getData | ( | ) | const |
Definition at line 39 of file Binary.cpp.
References Data, and llvm::MemoryBufferRef::getBuffer().
Referenced by llvm::object::ArchiveMemberHeader::ArchiveMemberHeader(), llvm::object::BigArchiveMemberHeader::BigArchiveMemberHeader(), checkDyldInfoCommand(), checkDysymtabCommand(), checkEncryptCommand(), checkLinkeditDataCommand(), checkNoteCommand(), checkSymtabCommand(), checkTwoLevelHintsCommand(), llvm::object::Archive::Child::Child(), createMemberHeaderParseError(), getLoadCommandInfo(), llvm::object::ArchiveMemberHeader::getName(), llvm::object::BigArchiveMemberHeader::getNextChildLoc(), getNextLoadCommandInfo(), llvm::object::ArchiveMemberHeader::getRawName(), llvm::object::BigArchiveMemberHeader::getRawName(), llvm::object::MachOObjectFile::getSectionContents(), llvm::object::MachOObjectFile::getSectionSize(), llvm::object::MachOObjectFile::getStringTableData(), llvm::object::MachOObjectFile::getSymbolName(), llvm::object::MachOUniversalBinary::MachOUniversalBinary(), llvm::MCJIT::notifyFreeingObject(), llvm::MCJIT::notifyObjectLoaded(), llvm::object::MachOUniversalBinary::ObjectForArch::ObjectForArch(), parseHeader(), parseSegmentLoadCommand(), llvm::object::MachOObjectFile::ReadULEB128s(), and llvm::object::WasmObjectFile::WasmObjectFile().
StringRef Binary::getFileName | ( | ) | const |
Definition at line 41 of file Binary.cpp.
References Data, and llvm::MemoryBufferRef::getBufferIdentifier().
Referenced by llvm::jitlink::COFFLinkGraphBuilder::COFFLinkGraphBuilder(), llvm::objcopy::createNewArchiveMembers(), llvm::logicalview::LVDWARFReader::createScopes(), llvm::object::IRObjectFile::findBitcodeInObject(), llvm::orc::getCOFFObjectFileSymbolInfo(), llvm::orc::getELFObjectFileSymbolInfo(), llvm::pdb::InputFile::getFilePath(), llvm::orc::getMachOObjectFileSymbolInfo(), llvm::orc::getMachOSliceRangeForTriple(), llvm::RuntimeDyldImpl::loadObjectImpl(), llvm::object::WindowsResourceParser::parse(), and llvm::object::writeUniversalBinary().
|
inlinestaticprotected |
Definition at line 85 of file Binary.h.
References ID_MachO32B, ID_MachO32L, ID_MachO64B, and ID_MachO64L.
Referenced by llvm::object::MachOObjectFile::is64Bit().
MemoryBufferRef Binary::getMemoryBufferRef | ( | ) | const |
Definition at line 43 of file Binary.cpp.
References Data.
Referenced by llvm::object::BigArchive::BigArchive(), llvm::object::Archive::Child::getAsBinary(), llvm::object::TapiUniversal::ObjectForArch::getAsObjectFile(), llvm::object::ArchiveMemberHeader::getNextChildLoc(), isAnyArm64COFF(), and isECObject().
|
inline |
Definition at line 163 of file Binary.h.
References llvm::Triple::COFF, llvm::Triple::ELF, llvm::Triple::GOFF, isCOFF(), isELF(), isGOFF(), isMachO(), llvm::Triple::MachO, and llvm::Triple::UnknownObjectFormat.
Referenced by llvm::InstrProfCorrelator::Context::get(), getInstrProfSection(), lookupAllocatableSection(), and lookupSections().
|
inline |
Definition at line 104 of file Binary.h.
Referenced by llvm::object::MachOObjectFile::is64Bit(), llvm::object::XCOFFObjectFile::is64Bit(), and llvm::object::TapiFile::TapiFile().
|
inlinevirtual |
Reimplemented in llvm::object::ELFObjectFile< ELFT >.
Definition at line 97 of file Binary.h.
References llvm::Error::success().
|
inline |
Definition at line 115 of file Binary.h.
References ID_Archive.
|
inline |
Definition at line 131 of file Binary.h.
References ID_COFF.
Referenced by llvm::InstrProfCorrelatorImpl< IntPtrT >::get(), llvm::object::getRelocationResolver(), getTripleObjectFormat(), isAnyArm64COFF(), llvm::RuntimeDyldCOFF::isCompatibleFile(), isECObject(), llvm::RuntimeDyld::loadObject(), and llvm::object::ObjectFile::makeTriple().
|
inline |
Definition at line 141 of file Binary.h.
References ID_COFFImportFile.
Referenced by isAnyArm64COFF(), isECObject(), and isSymbolic().
|
inline |
Definition at line 123 of file Binary.h.
References ID_ELF32L, and ID_ELF64B.
Referenced by llvm::InstrProfCorrelatorImpl< IntPtrT >::get(), llvm::object::getRelocationResolver(), getTripleObjectFormat(), llvm::RuntimeDyldELF::isCompatibleFile(), and llvm::RuntimeDyld::loadObject().
|
inline |
Definition at line 149 of file Binary.h.
References ID_GOFF.
Referenced by getTripleObjectFormat(), and llvm::object::ObjectFile::makeTriple().
|
inline |
Definition at line 145 of file Binary.h.
References ID_IR.
Referenced by isAnyArm64COFF(), isECObject(), and isSymbolic().
|
inline |
Definition at line 155 of file Binary.h.
References ID_ELF32B, ID_ELF64B, ID_MachO32B, ID_MachO64B, ID_XCOFF32, and ID_XCOFF64.
Referenced by checkThreadCommand(), llvm::symbolize::SymbolizableObjectFile::create(), extractSections(), llvm::InstrProfCorrelator::Context::get(), llvm::object::MachOObjectFile::getChainedFixupsSegments(), llvm::object::MachOObjectFile::getDyldChainedFixupTargets(), llvm::object::MachOObjectFile::getPlainRelocationExternal(), llvm::object::MachOObjectFile::getPlainRelocationSymbolNum(), llvm::RuntimeDyldImpl::loadObjectImpl(), llvm::BTFParser::ParseContext::makeExtractor(), llvm::object::MachOChainedFixupEntry::moveNext(), readMachOHeader(), and llvm::object::ELFObjectFileBase::setARMSubArch().
|
inline |
Definition at line 127 of file Binary.h.
References ID_MachO32L, and ID_MachO64B.
Referenced by llvm::InstrProfCorrelatorImpl< IntPtrT >::get(), llvm::object::getRelocationResolver(), getRemarksSectionName(), getTripleObjectFormat(), llvm::RuntimeDyldMachO::isCompatibleFile(), llvm::RuntimeDyld::loadObject(), and llvm::object::ObjectFile::makeTriple().
|
inline |
Definition at line 117 of file Binary.h.
References ID_MachOUniversalBinary.
|
inline |
Definition at line 151 of file Binary.h.
References ID_Minidump.
|
inline |
Definition at line 107 of file Binary.h.
References ID_EndObjects, and ID_StartObjects.
Referenced by isSymbolic().
|
inline |
Definition at line 139 of file Binary.h.
References ID_Offload.
|
inline |
Definition at line 111 of file Binary.h.
References isCOFFImportFile(), isIR(), isObject(), and isTapiFile().
|
inline |
|
inline |
Definition at line 121 of file Binary.h.
References ID_TapiUniversal.
|
inline |
Definition at line 137 of file Binary.h.
References ID_Wasm.
Referenced by llvm::object::getRelocationResolver(), and llvm::logicalview::LVBinaryReader::mapVirtualAddress().
|
inline |
|
inline |
Definition at line 135 of file Binary.h.
References ID_XCOFF32, and ID_XCOFF64.
Referenced by llvm::object::ObjectFile::makeTriple().
|
protected |
Definition at line 37 of file Binary.h.
Referenced by llvm::object::Archive::Archive(), llvm::object::ObjectFile::base(), llvm::object::BigArchive::BigArchive(), llvm::object::Archive::child_begin(), llvm::object::MinidumpFile::create(), llvm::object::ObjectFile::createObjectFile(), llvm::object::SymbolicFile::createSymbolicFile(), llvm::object::Archive::Child::getBuffer(), llvm::object::Archive::Child::getChildOffset(), llvm::object::COFFImportFile::getCOFFImportHeader(), llvm::object::ELFObjectFileBase::getCrelDecodeProblem(), getData(), llvm::object::COFFImportFile::getExportName(), getFileName(), getGlobalSymtabLocAndSize(), llvm::object::COFFObjectFile::getHybridObjectView(), llvm::object::XCOFFObjectFile::getImportFileTable(), llvm::object::ImportDirectoryEntryRef::getImportTableEntry(), getMemoryBufferRef(), llvm::object::MinidumpFile::getMemoryInfoList(), llvm::object::Archive::Child::getNext(), llvm::object::XCOFFObjectFile::getRawData(), llvm::object::COFFObjectFile::getRelocations(), llvm::object::COFFObjectFile::getSectionContents(), llvm::object::XCOFFObjectFile::getSectionContents(), llvm::object::XCOFFObjectFile::getSectionFileOffsetToRawData(), llvm::object::Archive::Child::getSize(), llvm::object::GOFFObjectFile::GOFFObjectFile(), llvm::object::Archive::isEmpty(), llvm::object::MachOUniversalBinary::MachOUniversalBinary(), llvm::object::COFFImportFile::printSymbolName(), llvm::object::XCOFFObjectFile::relocations(), llvm::object::COFFObjectFile::section_rel_begin(), llvm::object::COFFObjectFile::section_rel_end(), and llvm::object::OffloadBinary::write().