LLVM: llvm::ObjectFile Class Reference (original) (raw)
This class is the base class for all object file types. More...
#include "[llvm/Object/ObjectFile.h](ObjectFile%5F8h%5Fsource.html)"
| Static Public Member Functions |
|
| static Expected< OwningBinary< ObjectFile > > |
createObjectFile (StringRef ObjectPath) |
| static Expected< std::unique_ptr< ObjectFile > > |
createObjectFile (MemoryBufferRef Object, llvm::file_magic Type, bool InitContent=true) |
| static Expected< std::unique_ptr< ObjectFile > > |
createObjectFile (MemoryBufferRef Object) |
| static bool |
classof (const Binary *v) |
| static Expected< std::unique_ptr< COFFObjectFile > > |
createCOFFObjectFile (MemoryBufferRef Object) |
| static Expected< std::unique_ptr< ObjectFile > > |
createXCOFFObjectFile (MemoryBufferRef Object, unsigned FileType) |
| static Expected< std::unique_ptr< ObjectFile > > |
createELFObjectFile (MemoryBufferRef Object, bool InitContent=true) |
| static Expected< std::unique_ptr< MachOObjectFile > > |
createMachOObjectFile (MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0, size_t MachOFilesetEntryOffset=0) |
|
Create a MachOObjectFile instance from a given buffer. |
| static Expected< std::unique_ptr< ObjectFile > > |
createGOFFObjectFile (MemoryBufferRef Object) |
| static Expected< std::unique_ptr< WasmObjectFile > > |
createWasmObjectFile (MemoryBufferRef Object) |
| static Expected< std::unique_ptr< DXContainerObjectFile > > |
createDXContainerObjectFile (MemoryBufferRef Object) |
| Static Public Member Functions inherited from llvm::object::SymbolicFile |
|
| static Expected< std::unique_ptr< SymbolicFile > > |
createSymbolicFile (MemoryBufferRef Object, llvm::file_magic Type, LLVMContext *Context, bool InitContent=true) |
| static Expected< std::unique_ptr< SymbolicFile > > |
createSymbolicFile (MemoryBufferRef Object) |
| static bool |
classof (const Binary *v) |
| static bool |
isSymbolicFile (file_magic Type, const LLVMContext *Context) |
| Static Public Member Functions inherited from llvm::object::Binary |
|
| static Error |
checkOffset (MemoryBufferRef M, uintptr_t Addr, const uint64_t Size) |
| Additional Inherited Members |
|
| Protected Types inherited from llvm::object::Binary |
|
| 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_DXContainer, ID_EndObjects } |
| Static Protected Member Functions inherited from llvm::object::Binary |
|
| static unsigned int |
getELFType (bool isLE, bool is64Bits) |
| static unsigned int |
getMachOType (bool isLE, bool is64Bits) |
| Protected Attributes inherited from llvm::object::Binary |
|
| MemoryBufferRef |
Data |
This class is the base class for all object file types.
Concrete instances of this object are created by createObjectFile, which figures out which type to create.
Definition at line 231 of file ObjectFile.h.
◆ section_iterator_range
◆ symbol_iterator_range
◆ ObjectFile() [2/3]
| llvm::object::ObjectFile::ObjectFile ( ) |
delete |
◆ ObjectFile() [3/3]
◆ base()
| const uint8_t * llvm::object::ObjectFile::base ( ) const |
inlineprotected |
◆ classof()
| bool llvm::object::ObjectFile::classof ( const Binary * v) |
inlinestatic |
◆ createCOFFObjectFile()
◆ createDXContainerObjectFile()
◆ createELFObjectFile()
◆ createGOFFObjectFile()
◆ createMachOObjectFile()
Create a MachOObjectFile instance from a given buffer.
Parameters
| Buffer |
Memory buffer containing the MachO binary data. |
| UniversalCputype |
CPU type when the MachO part of a universal binary. |
| UniversalIndex |
Index of the MachO within a universal binary. |
| MachOFilesetEntryOffset |
Offset of the MachO entry in a fileset MachO. |
Returns
A std::unique_ptr to a MachOObjectFile instance on success.
Definition at line 5342 of file MachOObjectFile.cpp.
◆ createObjectFile() [1/3]
◆ createObjectFile() [2/3]
◆ createObjectFile() [3/3]
Returns
Pointer to ObjectFile subclass to handle this type of object.
Parameters
| ObjectPath |
The path to the object file. ObjectPath.isObject must return true. Create ObjectFile from path. |
Definition at line 211 of file ObjectFile.cpp.
◆ createWasmObjectFile()
◆ createXCOFFObjectFile()
◆ dynamic_relocation_sections()
| virtual std::vector< SectionRef > llvm::object::ObjectFile::dynamic_relocation_sections ( ) const |
inlinevirtual |
◆ getArch()
| virtual Triple::ArchType llvm::object::ObjectFile::getArch ( ) const |
pure virtual |
◆ getBytesInAddress()
| virtual uint8_t llvm::object::ObjectFile::getBytesInAddress ( ) const |
pure virtual |
The number of bytes used to represent an address in this object file format.
◆ getCommonSymbolSize()
| uint64_t llvm::object::ObjectFile::getCommonSymbolSize ( DataRefImpl Symb) const |
inline |
◆ getCommonSymbolSizeImpl()
| virtual uint64_t llvm::object::ObjectFile::getCommonSymbolSizeImpl ( DataRefImpl Symb) const |
protectedpure virtual |
◆ getFeatures()
| virtual StringRef llvm::object::ObjectFile::getFileFormatName ( ) const |
pure virtual |
◆ getOS()
| virtual Triple::OSType llvm::object::ObjectFile::getOS ( ) const |
inlinevirtual |
◆ getRelocatedSection()
◆ getRelocationOffset()
| virtual uint64_t llvm::object::ObjectFile::getRelocationOffset ( DataRefImpl Rel) const |
protectedpure virtual |
◆ getRelocationSymbol()
| virtual symbol_iterator llvm::object::ObjectFile::getRelocationSymbol ( DataRefImpl Rel) const |
protectedpure virtual |
◆ getRelocationType()
| virtual uint64_t llvm::object::ObjectFile::getRelocationType ( DataRefImpl Rel) const |
protectedpure virtual |
◆ getRelocationTypeName()
| virtual void llvm::object::ObjectFile::getRelocationTypeName ( DataRefImpl Rel, SmallVectorImpl< char > & Result ) const |
protectedpure virtual |
◆ getSectionAddress()
| virtual uint64_t llvm::object::ObjectFile::getSectionAddress ( DataRefImpl Sec) const |
protectedpure virtual |
◆ getSectionAlignment()
| virtual uint64_t llvm::object::ObjectFile::getSectionAlignment ( DataRefImpl Sec) const |
protectedpure virtual |
◆ getSectionContents()
| virtual Expected< ArrayRef< uint8_t > > llvm::object::ObjectFile::getSectionContents ( DataRefImpl Sec) const |
protectedpure virtual |
◆ getSectionIndex()
| virtual uint64_t llvm::object::ObjectFile::getSectionIndex ( DataRefImpl Sec) const |
protectedpure virtual |
◆ getSectionName()
| virtual Expected< StringRef > llvm::object::ObjectFile::getSectionName ( DataRefImpl Sec) const |
protectedpure virtual |
◆ getSectionSize()
| virtual uint64_t llvm::object::ObjectFile::getSectionSize ( DataRefImpl Sec) const |
protectedpure virtual |
◆ getStartAddress()
| virtual Expected< uint64_t > llvm::object::ObjectFile::getStartAddress ( ) const |
inlinevirtual |
◆ getSymbolAddress()
| virtual Expected< uint64_t > llvm::object::ObjectFile::getSymbolAddress ( DataRefImpl Symb) const |
protectedpure virtual |
◆ getSymbolAlignment()
◆ getSymbolName()
| virtual Expected< StringRef > llvm::object::ObjectFile::getSymbolName ( DataRefImpl Symb) const |
protectedpure virtual |
◆ getSymbolSection()
| virtual Expected< section_iterator > llvm::object::ObjectFile::getSymbolSection ( DataRefImpl Symb) const |
protectedpure virtual |
◆ getSymbolType()
| virtual Expected< SymbolRef::Type > llvm::object::ObjectFile::getSymbolType ( DataRefImpl Symb) const |
protectedpure virtual |
◆ getSymbolValue()
◆ getSymbolValueImpl()
| virtual uint64_t llvm::object::ObjectFile::getSymbolValueImpl ( DataRefImpl Symb) const |
protectedpure virtual |
◆ hasDebugInfo()
| bool ObjectFile::hasDebugInfo ( ) const |
virtual |
◆ isBerkeleyData()
◆ isBerkeleyText()
◆ isDebugSection()
◆ isReflectionSectionStrippable()
True if the reflection section can be stripped by the linker.
Definition at line 227 of file ObjectFile.cpp.
◆ isRelocatableObject()
| virtual bool llvm::object::ObjectFile::isRelocatableObject ( ) const |
pure virtual |
True if this is a relocatable object (.o/.obj).
◆ isSectionBitcode()
| bool ObjectFile::isSectionBitcode ( DataRefImpl Sec) const |
protectedvirtual |
◆ isSectionBSS()
| virtual bool llvm::object::ObjectFile::isSectionBSS ( DataRefImpl Sec) const |
protectedpure virtual |
◆ isSectionCompressed()
| virtual bool llvm::object::ObjectFile::isSectionCompressed ( DataRefImpl Sec) const |
protectedpure virtual |
◆ isSectionData()
| virtual bool llvm::object::ObjectFile::isSectionData ( DataRefImpl Sec) const |
protectedpure virtual |
◆ isSectionStripped()
| bool ObjectFile::isSectionStripped ( DataRefImpl Sec) const |
protectedvirtual |
◆ isSectionText()
| virtual bool llvm::object::ObjectFile::isSectionText ( DataRefImpl Sec) const |
protectedpure virtual |
◆ isSectionVirtual()
| virtual bool llvm::object::ObjectFile::isSectionVirtual ( DataRefImpl Sec) const |
protectedpure virtual |
◆ makeTriple()
| Triple ObjectFile::makeTriple |
( |
) |
const |
Create a triple from the data in this object file.
Definition at line 110 of file ObjectFile.cpp.
◆ mapDebugSectionName()
| virtual StringRef llvm::object::ObjectFile::mapDebugSectionName ( StringRef Name) const |
inlinevirtual |
Maps a debug section name to a standard DWARF section name.
Definition at line 357 of file ObjectFile.h.
◆ mapReflectionSectionNameToEnumValue()
◆ moveRelocationNext()
| virtual void llvm::object::ObjectFile::moveRelocationNext ( DataRefImpl & Rel) const |
protectedpure virtual |
◆ moveSectionNext()
| virtual void llvm::object::ObjectFile::moveSectionNext ( DataRefImpl & Sec) const |
protectedpure virtual |
◆ operator=()
◆ printSymbolName()
◆ section_begin()
| virtual section_iterator llvm::object::ObjectFile::section_begin ( ) const |
pure virtual |
◆ section_end()
| virtual section_iterator llvm::object::ObjectFile::section_end ( ) const |
pure virtual |
◆ section_rel_begin()
| virtual relocation_iterator llvm::object::ObjectFile::section_rel_begin ( DataRefImpl Sec) const |
protectedpure virtual |
◆ section_rel_end()
| virtual relocation_iterator llvm::object::ObjectFile::section_rel_end ( DataRefImpl Sec) const |
protectedpure virtual |
◆ sections()
◆ setARMSubArch()
| virtual void llvm::object::ObjectFile::setARMSubArch ( Triple & TheTriple) const |
inlinevirtual |
◆ symbols()
◆ tryGetCPUName()
| virtual std::optional< StringRef > llvm::object::ObjectFile::tryGetCPUName ( ) const |
inlinevirtual |
◆ RelocationRef
| friend class RelocationRef |
friend |
◆ SectionRef
◆ SymbolRef
The documentation for this class was generated from the following files: