Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Public Types |Public Member Functions |Static Public Member Functions |Protected Member Functions |Friends |List of all members
llvm::object::ObjectFile Class Referenceabstract

This class is the base class for all object file types.More...

#include "llvm/Object/ObjectFile.h"

Inheritance diagram for llvm::object::ObjectFile:
Inheritance graph
[legend]

Public Types

using symbol_iterator_range =iterator_range<symbol_iterator >
 
using section_iterator_range =iterator_range<section_iterator >
 
- Public Types inherited fromllvm::object::SymbolicFile
using basic_symbol_iterator_range =iterator_range<basic_symbol_iterator >
 

Public Member Functions

 ObjectFile ()=delete
 
 ObjectFile (constObjectFile &other)=delete
 
ObjectFileoperator= (constObjectFile &other)=delete
 
uint64_t getCommonSymbolSize (DataRefImpl Symb)const
 
virtual std::vector<SectionRefdynamic_relocation_sections ()const
 
symbol_iterator_range symbols ()const
 
virtualsection_iterator section_begin ()const =0
 
virtualsection_iterator section_end ()const =0
 
section_iterator_range sections ()const
 
virtualbool hasDebugInfo ()const
 
virtualuint8_t getBytesInAddress ()const =0
 The number of bytes used to represent an address in this object file format.
 
virtualStringRef getFileFormatName ()const =0
 
virtualTriple::ArchType getArch ()const =0
 
virtualTriple::OSType getOS ()const
 
virtualExpected<SubtargetFeaturesgetFeatures ()const =0
 
virtual std::optional<StringReftryGetCPUName ()const
 
virtual void setARMSubArch (Triple &TheTriple)const
 
virtualExpected<uint64_tgetStartAddress ()const
 
Triple makeTriple ()const
 Create a triple from the data in this object file.
 
virtualStringRef mapDebugSectionName (StringRefName)const
 Maps a debug section name to a standard DWARF section name.
 
virtualbool isRelocatableObject ()const =0
 True if this is a relocatable object (.o/.obj).
 
bool isReflectionSectionStrippable (llvm::binaryformat::Swift5ReflectionSectionKind ReflectionSectionKind)const
 True if the reflection section can be stripped by the linker.
 
- Public Member Functions inherited fromllvm::object::SymbolicFile
 SymbolicFile (unsigned intType,MemoryBufferRef Source)
 
 ~SymbolicFile () override
 
virtual void moveSymbolNext (DataRefImpl &Symb)const =0
 
virtualError printSymbolName (raw_ostream &OS,DataRefImpl Symb)const =0
 
virtualExpected<uint32_tgetSymbolFlags (DataRefImpl Symb)const =0
 
virtualbasic_symbol_iterator symbol_begin ()const =0
 
virtualbasic_symbol_iterator symbol_end ()const =0
 
virtualbool is64Bit ()const =0
 
basic_symbol_iterator_range symbols ()const
 
- Public Member Functions inherited fromllvm::object::Binary
 Binary ()=delete
 
 Binary (constBinary &other)=delete
 
virtual ~Binary ()
 
virtualError 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

staticExpected<OwningBinary<ObjectFile > > createObjectFile (StringRef ObjectPath)
 
staticExpected< std::unique_ptr<ObjectFile > > createObjectFile (MemoryBufferRef Object,llvm::file_magicType,bool InitContent=true)
 
staticExpected< std::unique_ptr<ObjectFile > > createObjectFile (MemoryBufferRef Object)
 
staticbool classof (constBinary *v)
 
staticExpected< std::unique_ptr<COFFObjectFile > > createCOFFObjectFile (MemoryBufferRef Object)
 
staticExpected< std::unique_ptr<ObjectFile > > createXCOFFObjectFile (MemoryBufferRef Object,unsigned FileType)
 
staticExpected< std::unique_ptr<ObjectFile > > createELFObjectFile (MemoryBufferRef Object,bool InitContent=true)
 
staticExpected< std::unique_ptr<MachOObjectFile > > createMachOObjectFile (MemoryBufferRef Object,uint32_t UniversalCputype=0,uint32_t UniversalIndex=0, size_t MachOFilesetEntryOffset=0)
 Create aMachOObjectFile instance from a given buffer.
 
staticExpected< std::unique_ptr<ObjectFile > > createGOFFObjectFile (MemoryBufferRef Object)
 
staticExpected< std::unique_ptr<WasmObjectFile > > createWasmObjectFile (MemoryBufferRef Object)
 
- Static Public Member Functions inherited fromllvm::object::SymbolicFile
staticExpected< std::unique_ptr<SymbolicFile > > createSymbolicFile (MemoryBufferRef Object,llvm::file_magicType,LLVMContext *Context,bool InitContent=true)
 
staticExpected< std::unique_ptr<SymbolicFile > > createSymbolicFile (MemoryBufferRef Object)
 
staticbool classof (constBinary *v)
 
staticbool isSymbolicFile (file_magicType,constLLVMContext *Context)
 
- Static Public Member Functions inherited fromllvm::object::Binary
staticError checkOffset (MemoryBufferRef M, uintptr_tAddr,constuint64_tSize)
 

Protected Member Functions

 ObjectFile (unsigned intType,MemoryBufferRef Source)
 
constuint8_tbase ()const
 
virtualExpected<StringRefgetSymbolName (DataRefImpl Symb)const =0
 
Error printSymbolName (raw_ostream &OS,DataRefImpl Symb)const override
 
virtualExpected<uint64_tgetSymbolAddress (DataRefImpl Symb)const =0
 
virtualuint64_t getSymbolValueImpl (DataRefImpl Symb)const =0
 
virtualuint32_t getSymbolAlignment (DataRefImpl Symb)const
 
virtualuint64_t getCommonSymbolSizeImpl (DataRefImpl Symb)const =0
 
virtualExpected<SymbolRef::TypegetSymbolType (DataRefImpl Symb)const =0
 
virtualExpected<section_iteratorgetSymbolSection (DataRefImpl Symb)const =0
 
virtual void moveSectionNext (DataRefImpl &Sec)const =0
 
virtualExpected<StringRefgetSectionName (DataRefImpl Sec)const =0
 
virtualuint64_t getSectionAddress (DataRefImpl Sec)const =0
 
virtualuint64_t getSectionIndex (DataRefImpl Sec)const =0
 
virtualuint64_t getSectionSize (DataRefImpl Sec)const =0
 
virtualExpected<ArrayRef<uint8_t > > getSectionContents (DataRefImpl Sec)const =0
 
virtualuint64_t getSectionAlignment (DataRefImpl Sec)const =0
 
virtualbool isSectionCompressed (DataRefImpl Sec)const =0
 
virtualbool isSectionText (DataRefImpl Sec)const =0
 
virtualbool isSectionData (DataRefImpl Sec)const =0
 
virtualbool isSectionBSS (DataRefImpl Sec)const =0
 
virtualbool isSectionVirtual (DataRefImpl Sec)const =0
 
virtualbool isSectionBitcode (DataRefImpl Sec)const
 
virtualbool isSectionStripped (DataRefImpl Sec)const
 
virtualbool isBerkeleyText (DataRefImpl Sec)const
 
virtualbool isBerkeleyData (DataRefImpl Sec)const
 
virtualbool isDebugSection (DataRefImpl Sec)const
 
virtualrelocation_iterator section_rel_begin (DataRefImpl Sec)const =0
 
virtualrelocation_iterator section_rel_end (DataRefImpl Sec)const =0
 
virtualExpected<section_iteratorgetRelocatedSection (DataRefImpl Sec)const
 
virtual void moveRelocationNext (DataRefImpl &Rel)const =0
 
virtualuint64_t getRelocationOffset (DataRefImpl Rel)const =0
 
virtualsymbol_iterator getRelocationSymbol (DataRefImpl Rel)const =0
 
virtualuint64_t getRelocationType (DataRefImpl Rel)const =0
 
virtual void getRelocationTypeName (DataRefImpl Rel,SmallVectorImpl<char > &Result)const =0
 
virtualllvm::binaryformat::Swift5ReflectionSectionKind mapReflectionSectionNameToEnumValue (StringRefSectionName)const
 
Expected<uint64_tgetSymbolValue (DataRefImpl Symb)const
 
- Protected Member Functions inherited fromllvm::object::Binary
 Binary (unsigned intType,MemoryBufferRef Source)
 

Friends

class SymbolRef
 
class SectionRef
 
class RelocationRef
 

Additional Inherited Members

- Protected Types inherited fromllvm::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_EndObjects
}
 
- Static Protected Member Functions inherited fromllvm::object::Binary
staticunsigned int getELFType (bool isLE,bool is64Bits)
 
staticunsigned int getMachOType (bool isLE,bool is64Bits)
 
- Protected Attributes inherited fromllvm::object::Binary
MemoryBufferRef Data
 

Detailed Description

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 line229 of fileObjectFile.h.

Member Typedef Documentation

◆ section_iterator_range

usingllvm::object::ObjectFile::section_iterator_range =iterator_range<section_iterator>

Definition at line328 of fileObjectFile.h.

◆ symbol_iterator_range

usingllvm::object::ObjectFile::symbol_iterator_range =iterator_range<symbol_iterator>

Definition at line320 of fileObjectFile.h.

Constructor & Destructor Documentation

◆ ObjectFile()[1/3]

ObjectFile::ObjectFile(unsigned int Type,
MemoryBufferRef Source 
)
protected

Definition at line43 of fileObjectFile.cpp.

◆ ObjectFile()[2/3]

llvm::object::ObjectFile::ObjectFile()
delete

◆ ObjectFile()[3/3]

llvm::object::ObjectFile::ObjectFile(constObjectFileother)
delete

Member Function Documentation

◆ base()

constuint8_t * llvm::object::ObjectFile::base() const
inlineprotected

Definition at line235 of fileObjectFile.h.

Referencesllvm::object::Binary::Data, andllvm::MemoryBufferRef::getBufferStart().

Referenced byllvm::object::COFFObjectFile::getDOSHeader(),llvm::object::COFFObjectFile::getHybridObjectView(),llvm::object::COFFObjectFile::getRelocations(),llvm::object::COFFObjectFile::getRvaAndSizeAsBytes(),llvm::object::COFFObjectFile::getRvaPtr(),llvm::object::COFFObjectFile::getSectionContents(),llvm::object::XCOFFObjectFile::getSectionContents(),llvm::object::XCOFFObjectFile::getSectionFileOffsetToRawData(),llvm::object::COFFObjectFile::getSymbolAuxData(),llvm::object::GOFFObjectFile::GOFFObjectFile(),llvm::object::COFFObjectFile::section_rel_begin(), andllvm::object::COFFObjectFile::section_rel_end().

◆ classof()

staticbool llvm::object::ObjectFile::classof(constBinaryv)
inlinestatic

Definition at line380 of fileObjectFile.h.

◆ createCOFFObjectFile()

Expected< std::unique_ptr<COFFObjectFile > > ObjectFile::createCOFFObjectFile(MemoryBufferRef Object)
static

Definition at line1896 of fileCOFFObjectFile.cpp.

Referencesllvm::object::COFFObjectFile::create().

Referenced byllvm::jitlink::createLinkGraphFromCOFFObject_x86_64(), andcreateObjectFile().

◆ createELFObjectFile()

Expected< std::unique_ptr<ObjectFile > > ObjectFile::createELFObjectFile(MemoryBufferRef Object,
bool InitContent =true 
)
static

Definition at line72 of fileELFObjectFile.cpp.

Referencesllvm::countr_zero(),llvm::object::createError(),llvm::ELF::ELFCLASS32,llvm::ELF::ELFCLASS64,llvm::ELF::ELFDATA2LSB,llvm::ELF::ELFDATA2MSB,llvm::MemoryBufferRef::getBuffer(),llvm::MemoryBufferRef::getBufferStart(), andllvm::object::getElfArchType().

Referenced byllvm::jitlink::createLinkGraphFromELFObject_aarch32(),llvm::jitlink::createLinkGraphFromELFObject_aarch64(),llvm::jitlink::createLinkGraphFromELFObject_i386(),llvm::jitlink::createLinkGraphFromELFObject_loongarch(),llvm::jitlink::createLinkGraphFromELFObject_ppc64(),llvm::jitlink::createLinkGraphFromELFObject_riscv(),llvm::jitlink::createLinkGraphFromELFObject_x86_64(), andcreateObjectFile().

◆ createGOFFObjectFile()

Expected< std::unique_ptr<ObjectFile > > ObjectFile::createGOFFObjectFile(MemoryBufferRef Object)
static

Definition at line28 of fileGOFFObjectFile.cpp.

Referencesllvm::Error::success().

◆ createMachOObjectFile()

Expected< std::unique_ptr<MachOObjectFile > > ObjectFile::createMachOObjectFile(MemoryBufferRef Buffer,
uint32_t UniversalCputype =0,
uint32_t UniversalIndex =0,
size_t MachOFilesetEntryOffset =0 
)
static

Create aMachOObjectFile instance from a given buffer.

Parameters
BufferMemory buffer containing theMachO binary data.
UniversalCputypeCPU type when theMachO part of a universal binary.
UniversalIndexIndex of theMachO within a universal binary.
MachOFilesetEntryOffsetOffset of theMachO entry in a filesetMachO.
Returns
A std::unique_ptr to aMachOObjectFile instance on success.

Definition at line5319 of fileMachOObjectFile.cpp.

Referencesllvm::object::MachOObjectFile::create(),llvm::MemoryBufferRef::getBuffer(),llvm::object::invalid_file_type, andllvm::StringRef::slice().

Referenced byllvm::jitlink::createLinkGraphFromMachOObject_arm64(),llvm::jitlink::createLinkGraphFromMachOObject_x86_64(),createObjectFile(), andllvm::object::MachOUniversalBinary::ObjectForArch::getAsObjectFile().

◆ createObjectFile()[1/3]

staticExpected< std::unique_ptr<ObjectFile > > llvm::object::ObjectFile::createObjectFile(MemoryBufferRef Object)
inlinestatic

Definition at line376 of fileObjectFile.h.

ReferencescreateObjectFile(), andllvm::file_magic::unknown.

◆ createObjectFile()[2/3]

Expected< std::unique_ptr<ObjectFile > > ObjectFile::createObjectFile(MemoryBufferRef Object,
llvm::file_magic Type,
bool InitContent =true 
)
static

Definition at line149 of fileObjectFile.cpp.

Referencesllvm::file_magic::archive,llvm::file_magic::bitcode,llvm::file_magic::clang_ast,llvm::file_magic::coff_cl_gl_object,llvm::file_magic::coff_import_library,llvm::file_magic::coff_object,createCOFFObjectFile(),createELFObjectFile(),createMachOObjectFile(),createWasmObjectFile(),createXCOFFObjectFile(),llvm::file_magic::cuda_fatbinary,llvm::object::Binary::Data,llvm::file_magic::dxcontainer_object,llvm::file_magic::elf,llvm::file_magic::elf_core,llvm::file_magic::elf_executable,llvm::file_magic::elf_relocatable,llvm::file_magic::elf_shared_object,llvm::errorCodeToError(),llvm::file_magic::goff_object,llvm::object::Binary::ID_XCOFF32,llvm::object::Binary::ID_XCOFF64,llvm::identify_magic(),llvm::object::invalid_file_type,llvm_unreachable,llvm::file_magic::macho_bundle,llvm::file_magic::macho_core,llvm::file_magic::macho_dsym_companion,llvm::file_magic::macho_dynamic_linker,llvm::file_magic::macho_dynamically_linked_shared_lib,llvm::file_magic::macho_dynamically_linked_shared_lib_stub,llvm::file_magic::macho_executable,llvm::file_magic::macho_file_set,llvm::file_magic::macho_fixed_virtual_memory_shared_lib,llvm::file_magic::macho_kext_bundle,llvm::file_magic::macho_object,llvm::file_magic::macho_preload_executable,llvm::file_magic::macho_universal_binary,llvm::file_magic::minidump,llvm::file_magic::offload_binary,llvm::file_magic::offload_bundle,llvm::file_magic::offload_bundle_compressed,llvm::file_magic::pdb,llvm::file_magic::pecoff_executable,llvm::file_magic::spirv_object,llvm::file_magic::tapi_file,llvm::file_magic::unknown,llvm::file_magic::wasm_object,llvm::file_magic::windows_resource,llvm::file_magic::xcoff_object_32, andllvm::file_magic::xcoff_object_64.

◆ createObjectFile()[3/3]

Expected<OwningBinary<ObjectFile > > ObjectFile::createObjectFile(StringRef ObjectPath)
static
Returns
Pointer toObjectFile subclass to handle this type of object.
Parameters
ObjectPathThe path to the object file. ObjectPath.isObject must return true. CreateObjectFile from path.

Definition at line209 of fileObjectFile.cpp.

ReferencescreateObjectFile(),llvm::errorCodeToError(),llvm::Expected< T >::get(),llvm::ErrorOr< T >::get(),llvm::ErrorOr< T >::getError(),llvm::MemoryBuffer::getFile(), andllvm::Expected< T >::takeError().

Referenced bycreateObjectFile(),llvm::object::SymbolicFile::createSymbolicFile(),llvm::NewArchiveMember::detectKindFromObject(),llvm::orc::RTDyldObjectLinkingLayer::emit(),llvm::object::extractOffloadBinaries(),llvm::object::IRObjectFile::findBitcodeInMemBuffer(),llvm::MCJIT::generateCodeForModule(),llvm::orc::getObjectFileInterface(),LLVMCreateObjectFile(),llvm::xray::loadInstrumentationMap(),llvm::cgdata::mergeCodeGenData(),llvm::orc::ForceLoadMachOArchiveMembers::operator()(),llvm::orc::SimpleCompiler::operator()(),llvm::dwarf_linker::parallel::SectionDescriptor::setSizesForSectionCreatedByAsmPrinter(),llvm::write(), andllvm::yaml::yaml2ObjectFile().

◆ createWasmObjectFile()

Expected< std::unique_ptr<WasmObjectFile > > ObjectFile::createWasmObjectFile(MemoryBufferRef Object)
static

Definition at line66 of fileWasmObjectFile.cpp.

Referencesllvm::Error::success().

Referenced bycreateObjectFile().

◆ createXCOFFObjectFile()

Expected< std::unique_ptr<ObjectFile > > llvm::object::ObjectFile::createXCOFFObjectFile(MemoryBufferRef Object,
unsigned FileType 
)
static

Definition at line1232 of fileXCOFFObjectFile.cpp.

Referenced bycreateObjectFile().

◆ dynamic_relocation_sections()

virtual std::vector<SectionRef > llvm::object::ObjectFile::dynamic_relocation_sections() const
inlinevirtual

Reimplemented inllvm::object::ELFObjectFile< ELFT >.

Definition at line316 of fileObjectFile.h.

◆ getArch()

virtualTriple::ArchType llvm::object::ObjectFile::getArch() const
pure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::GOFFObjectFile,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::symbolize::SymbolizableObjectFile::create(),llvm::DWARFContext::getArch(),llvm::object::getRelocationResolver(),llvm::RuntimeDyld::loadObject(),llvm::RuntimeDyldImpl::loadObjectImpl(), andmakeTriple().

◆ getBytesInAddress()

virtualuint8_t llvm::object::ObjectFile::getBytesInAddress() const
pure virtual

The number of bytes used to represent an address in this object file format.

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::GOFFObjectFile,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::symbolize::SymbolizableObjectFile::create(),llvm::object::getRelocationResolver(), andllvm::BTFParser::ParseContext::makeExtractor().

◆ getCommonSymbolSize()

uint64_t llvm::object::ObjectFile::getCommonSymbolSize(DataRefImpl Symb) const
inline

Definition at line307 of fileObjectFile.h.

Referencesassert(),getCommonSymbolSizeImpl(),llvm::object::SymbolicFile::getSymbolFlags(),llvm::report_fatal_error(),llvm::object::BasicSymbolRef::SF_Common, andllvm::Expected< T >::takeError().

Referenced byllvm::object::SymbolRef::getCommonSize(), andgetSymbolValue().

◆ getCommonSymbolSizeImpl()

virtualuint64_t llvm::object::ObjectFile::getCommonSymbolSizeImpl(DataRefImpl Symb) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced bygetCommonSymbolSize().

◆ getFeatures()

virtualExpected<SubtargetFeatures > llvm::object::ObjectFile::getFeatures() const
pure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFileBase,llvm::object::GOFFObjectFile,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

◆ getFileFormatName()

virtualStringRef llvm::object::ObjectFile::getFileFormatName() const
pure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::GOFFObjectFile,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

◆ getOS()

virtualTriple::OSType llvm::object::ObjectFile::getOS() const
inlinevirtual

Reimplemented inllvm::object::ELFObjectFile< ELFT >.

Definition at line341 of fileObjectFile.h.

Referencesllvm::Triple::UnknownOS.

Referenced bymakeTriple().

◆ getRelocatedSection()

Expected<section_iterator > ObjectFile::getRelocatedSection(DataRefImpl Sec) const
protectedvirtual

Reimplemented inllvm::object::ELFObjectFile< ELFT >.

Definition at line105 of fileObjectFile.cpp.

ReferencesSectionRef.

Referenced byllvm::object::SectionRef::getRelocatedSection().

◆ getRelocationOffset()

virtualuint64_t llvm::object::ObjectFile::getRelocationOffset(DataRefImpl Rel) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::RelocationRef::getOffset().

◆ getRelocationSymbol()

virtualsymbol_iterator llvm::object::ObjectFile::getRelocationSymbol(DataRefImpl Rel) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::RelocationRef::getSymbol().

◆ getRelocationType()

virtualuint64_t llvm::object::ObjectFile::getRelocationType(DataRefImpl Rel) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::RelocationRef::getType().

◆ getRelocationTypeName()

virtual void llvm::object::ObjectFile::getRelocationTypeName(DataRefImpl Rel,
SmallVectorImpl<char > & Result 
) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::RelocationRef::getTypeName().

◆ getSectionAddress()

virtualuint64_t llvm::object::ObjectFile::getSectionAddress(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::getAddress().

◆ getSectionAlignment()

virtualuint64_t llvm::object::ObjectFile::getSectionAlignment(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::getAlignment().

◆ getSectionContents()

virtualExpected<ArrayRef<uint8_t > > llvm::object::ObjectFile::getSectionContents(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::getContents().

◆ getSectionIndex()

virtualuint64_t llvm::object::ObjectFile::getSectionIndex(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::getIndex().

◆ getSectionName()

virtualExpected<StringRef > llvm::object::ObjectFile::getSectionName(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::getName(), andisSectionBitcode().

◆ getSectionSize()

virtualuint64_t llvm::object::ObjectFile::getSectionSize(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::getSize().

◆ getStartAddress()

virtualExpected<uint64_t > llvm::object::ObjectFile::getStartAddress() const
inlinevirtual

Reimplemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >, andllvm::object::XCOFFObjectFile.

Definition at line347 of fileObjectFile.h.

Referencesllvm::errorCodeToError(), andllvm::object::parse_failed.

◆ getSymbolAddress()

virtualExpected<uint64_t > llvm::object::ObjectFile::getSymbolAddress(DataRefImpl Symb) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SymbolRef::getAddress().

◆ getSymbolAlignment()

uint32_t ObjectFile::getSymbolAlignment(DataRefImpl Symb) const
protectedvirtual

Reimplemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Definition at line77 of fileObjectFile.cpp.

Referenced byllvm::object::SymbolRef::getAlignment().

◆ getSymbolName()

virtualExpected<StringRef > llvm::object::ObjectFile::getSymbolName(DataRefImpl Symb) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SymbolRef::getName(), andprintSymbolName().

◆ getSymbolSection()

virtualExpected<section_iterator > llvm::object::ObjectFile::getSymbolSection(DataRefImpl Symb) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SymbolRef::getSection().

◆ getSymbolType()

virtualExpected<SymbolRef::Type > llvm::object::ObjectFile::getSymbolType(DataRefImpl Symb) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SymbolRef::getType().

◆ getSymbolValue()

Expected<uint64_t > ObjectFile::getSymbolValue(DataRefImpl Symb) const
protected

Definition at line56 of fileObjectFile.cpp.

ReferencesgetCommonSymbolSize(),llvm::object::SymbolicFile::getSymbolFlags(),getSymbolValueImpl(),llvm::Ref,llvm::object::BasicSymbolRef::SF_Common, andllvm::object::BasicSymbolRef::SF_Undefined.

Referenced byllvm::object::COFFObjectFile::getSymbolAddress(),llvm::object::MachOObjectFile::getSymbolAddress(),llvm::object::WasmObjectFile::getSymbolAddress(), andllvm::object::SymbolRef::getValue().

◆ getSymbolValueImpl()

virtualuint64_t llvm::object::ObjectFile::getSymbolValueImpl(DataRefImpl Symb) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced bygetSymbolValue().

◆ hasDebugInfo()

bool ObjectFile::hasDebugInfo() const
virtual

Definition at line99 of fileObjectFile.cpp.

Referencesllvm::any_of(),llvm::object::SectionRef::isDebugSection(), andsections().

Referenced byllvm::symbolize::useBTFContext().

◆ isBerkeleyData()

bool ObjectFile::isBerkeleyData(DataRefImpl Sec) const
protectedvirtual

Reimplemented inllvm::object::ELFObjectFile< ELFT >.

Definition at line93 of fileObjectFile.cpp.

ReferencesisSectionData().

Referenced byllvm::object::SectionRef::isBerkeleyData().

◆ isBerkeleyText()

bool ObjectFile::isBerkeleyText(DataRefImpl Sec) const
protectedvirtual

Reimplemented inllvm::object::ELFObjectFile< ELFT >.

Definition at line89 of fileObjectFile.cpp.

ReferencesisSectionText().

Referenced byllvm::object::SectionRef::isBerkeleyText().

◆ isDebugSection()

bool ObjectFile::isDebugSection(DataRefImpl Sec) const
protectedvirtual

Reimplemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile, andllvm::object::XCOFFObjectFile.

Definition at line97 of fileObjectFile.cpp.

Referenced byllvm::object::SectionRef::isDebugSection().

◆ isReflectionSectionStrippable()

bool ObjectFile::isReflectionSectionStrippable(llvm::binaryformat::Swift5ReflectionSectionKind ReflectionSectionKind) const

True if the reflection section can be stripped by the linker.

Definition at line225 of fileObjectFile.cpp.

◆ isRelocatableObject()

virtualbool llvm::object::ObjectFile::isRelocatableObject() const
pure virtual

True if this is a relocatable object (.o/.obj).

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::GOFFObjectFile,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byshouldSkipSectionFirstByte().

◆ isSectionBitcode()

bool ObjectFile::isSectionBitcode(DataRefImpl Sec) const
protectedvirtual

Reimplemented inllvm::object::MachOObjectFile.

Definition at line79 of fileObjectFile.cpp.

Referencesllvm::consumeError(),getSectionName(), andllvm::Expected< T >::takeError().

Referenced byllvm::object::SectionRef::isBitcode().

◆ isSectionBSS()

virtualbool llvm::object::ObjectFile::isSectionBSS(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::isBSS().

◆ isSectionCompressed()

virtualbool llvm::object::ObjectFile::isSectionCompressed(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::isCompressed().

◆ isSectionData()

virtualbool llvm::object::ObjectFile::isSectionData(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byisBerkeleyData(), andllvm::object::SectionRef::isData().

◆ isSectionStripped()

bool ObjectFile::isSectionStripped(DataRefImpl Sec) const
protectedvirtual

Reimplemented inllvm::object::MachOObjectFile.

Definition at line87 of fileObjectFile.cpp.

Referenced byllvm::object::SectionRef::isStripped().

◆ isSectionText()

virtualbool llvm::object::ObjectFile::isSectionText(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byisBerkeleyText(), andllvm::object::SectionRef::isText().

◆ isSectionVirtual()

virtualbool llvm::object::ObjectFile::isSectionVirtual(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::isVirtual().

◆ makeTriple()

Triple ObjectFile::makeTriple() const

Create a triple from the data in this object file.

Definition at line109 of fileObjectFile.cpp.

Referencesllvm::Triple::AIX,llvm::Triple::AMD,llvm::Triple::arm,llvm::Triple::armeb,getArch(),getOS(),llvm::Triple::GOFF,llvm::Triple::isAMDGPU(),llvm::object::Binary::isCOFF(),llvm::object::Binary::isGOFF(),llvm::object::Binary::isMachO(),llvm::Triple::isNVPTX(),llvm::object::Binary::isXCOFF(),llvm::Triple::MachO,llvm::Triple::NVIDIA,OS,llvm::Triple::setArch(),setARMSubArch(),llvm::Triple::setObjectFormat(),llvm::Triple::setOS(),llvm::Triple::setTriple(),llvm::Triple::setVendor(),llvm::Triple::thumb,llvm::Triple::UnknownOS,llvm::Triple::XCOFF, andllvm::Triple::ZOS.

Referenced byllvm::object::ELFObjectFileBase::getPltEntries(),getUUID(),llvm::CodeGenDataReader::mergeFromObjectFile(), andllvm::symbolize::useBTFContext().

◆ mapDebugSectionName()

virtualStringRef llvm::object::ObjectFile::mapDebugSectionName(StringRef Name) const
inlinevirtual

Maps a debug section name to a standard DWARF section name.

Reimplemented inllvm::object::COFFObjectFile,llvm::object::MachOObjectFile, andllvm::object::XCOFFObjectFile.

Definition at line355 of fileObjectFile.h.

ReferencesName.

◆ mapReflectionSectionNameToEnumValue()

virtualllvm::binaryformat::Swift5ReflectionSectionKind llvm::object::ObjectFile::mapReflectionSectionNameToEnumValue(StringRef SectionName) const
inlineprotectedvirtual

Reimplemented inllvm::object::MachOObjectFile.

Definition at line296 of fileObjectFile.h.

Referencesllvm::binaryformat::unknown.

◆ moveRelocationNext()

virtual void llvm::object::ObjectFile::moveRelocationNext(DataRefImplRel) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::RelocationRef::moveNext().

◆ moveSectionNext()

virtual void llvm::object::ObjectFile::moveSectionNext(DataRefImplSec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::moveNext().

◆ operator=()

ObjectFile & llvm::object::ObjectFile::operator=(constObjectFileother)
delete

◆ printSymbolName()

Error ObjectFile::printSymbolName(raw_ostreamOS,
DataRefImpl Symb 
) const
overrideprotectedvirtual

Implementsllvm::object::SymbolicFile.

Definition at line69 of fileObjectFile.cpp.

ReferencesgetSymbolName(),Name,OS, andllvm::Error::success().

◆ section_begin()

virtualsection_iterator llvm::object::ObjectFile::section_begin() const
pure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::GOFFObjectFile,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionFilter::begin(),llvm::RuntimeDyldImpl::computeGOTSize(),llvm::RuntimeDyldImpl::computeSectionStubBufSize(),llvm::RuntimeDyldImpl::computeTotalAllocSize(),llvm::RuntimeDyldELF::finalizeLoad(),llvm::RuntimeDyldImpl::loadObjectImpl(), andsections().

◆ section_end()

virtualsection_iterator llvm::object::ObjectFile::section_end() const
pure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::GOFFObjectFile,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionFilter::begin(),llvm::RuntimeDyldImpl::computeGOTSize(),llvm::RuntimeDyldImpl::computeSectionStubBufSize(),llvm::RuntimeDyldImpl::computeTotalAllocSize(),llvm::object::SectionFilter::end(),llvm::RuntimeDyldELF::finalizeLoad(),getSymbolInfo(),llvm::RuntimeDyldImpl::loadObjectImpl(),llvm::RuntimeDyldCOFFAArch64::processRelocationRef(),llvm::RuntimeDyldCOFFI386::processRelocationRef(),llvm::RuntimeDyldCOFFThumb::processRelocationRef(),llvm::RuntimeDyldCOFFX86_64::processRelocationRef(),llvm::RuntimeDyldELF::processRelocationRef(), andsections().

◆ section_rel_begin()

virtualrelocation_iterator llvm::object::ObjectFile::section_rel_begin(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::relocation_begin().

◆ section_rel_end()

virtualrelocation_iterator llvm::object::ObjectFile::section_rel_end(DataRefImpl Sec) const
protectedpure virtual

Implemented inllvm::object::COFFObjectFile,llvm::object::ELFObjectFile< ELFT >,llvm::object::MachOObjectFile,llvm::object::WasmObjectFile, andllvm::object::XCOFFObjectFile.

Referenced byllvm::object::SectionRef::relocation_end().

◆ sections()

section_iterator_range llvm::object::ObjectFile::sections() const
inline

Definition at line329 of fileObjectFile.h.

Referencessection_begin(), andsection_end().

Referenced byllvm::object::BindRebaseSegInfo::BindRebaseSegInfo(),llvm::objcopy::wasm::Reader::create(),llvm::symbolize::SymbolizableObjectFile::create(),llvm::RuntimeDyldMachOCRTPBase< Impl >::finalizeLoad(),llvm::object::IRObjectFile::findBitcodeInObject(),llvm::orc::getCOFFObjectFileSymbolInfo(),llvm::object::ResourceSectionRef::getContents(),llvm::orc::getELFObjectFileSymbolInfo(),getInstrProfSection(),llvm::orc::getMachOObjectFileSymbolInfo(),llvm::object::ELFObjectFileBase::getPltEntries(),llvm::remarks::getRemarksSectionContents(),llvm::object::COFFObjectFile::getRvaAndSizeAsBytes(),llvm::object::COFFObjectFile::getRvaPtr(),llvm::object::MachOObjectFile::getSection(),getUUID(),llvm::BTFParser::hasBTFSections(),hasDebugInfo(),lookupSections(),llvm::logicalview::LVBinaryReader::mapVirtualAddress(),llvm::CodeGenDataReader::mergeFromObjectFile(),llvm::BTFParser::parse(),readMachOHeader(), andllvm::jitlink::COFFLinkGraphBuilder::sections().

◆ setARMSubArch()

virtual void llvm::object::ObjectFile::setARMSubArch(TripleTheTriple) const
inlinevirtual

Reimplemented inllvm::object::ELFObjectFileBase.

Definition at line346 of fileObjectFile.h.

Referenced bymakeTriple().

◆ symbols()

symbol_iterator_range llvm::object::ObjectFile::symbols() const
inline

Definition at line321 of fileObjectFile.h.

Referencesllvm::object::SymbolicFile::symbol_begin(), andllvm::object::SymbolicFile::symbol_end().

Referenced byaccumulateLocs(),llvm::object::MachOObjectFile::checkSymbolTable(),llvm::gsym::ObjectFileTransformer::convert(),llvm::orc::getCOFFObjectFileSymbolInfo(),llvm::orc::getGenericObjectFileSymbolInfo(),llvm::orc::getMachOObjectFileSymbolInfo(),llvm::RuntimeDyldImpl::loadObjectImpl(), andreadSymbols().

◆ tryGetCPUName()

virtual std::optional<StringRef > llvm::object::ObjectFile::tryGetCPUName() const
inlinevirtual

Reimplemented inllvm::object::ELFObjectFileBase, andllvm::object::XCOFFObjectFile.

Definition at line343 of fileObjectFile.h.

Friends And Related Function Documentation

◆ RelocationRef

friend classRelocationRef
friend

Definition at line287 of fileObjectFile.h.

Referenced byllvm::object::MachOObjectFile::extrel_begin(),llvm::object::MachOObjectFile::extrel_end(),llvm::object::XCOFFRelocation< llvm::support::ubig32_t >::getRelocatedLength(),llvm::object::MachOObjectFile::locrel_begin(),llvm::object::MachOObjectFile::locrel_end(),llvm::object::COFFObjectFile::section_rel_begin(),llvm::object::MachOObjectFile::section_rel_begin(),llvm::object::WasmObjectFile::section_rel_begin(),llvm::object::COFFObjectFile::section_rel_end(),llvm::object::MachOObjectFile::section_rel_end(),llvm::object::WasmObjectFile::section_rel_end(), andllvm::object::XCOFFObjectFile::section_rel_end().

◆ SectionRef

friend classSectionRef
friend

Definition at line261 of fileObjectFile.h.

Referenced byllvm::object::MachOObjectFile::getAnyRelocationSection(),getRelocatedSection(),llvm::object::MachOObjectFile::getRelocationRelocatedSection(),llvm::object::MachOObjectFile::getSection(),llvm::object::COFFObjectFile::getSymbolSection(),llvm::object::MachOObjectFile::getSymbolSection(),llvm::object::WasmObjectFile::getSymbolSection(),llvm::object::XCOFFObjectFile::getSymbolSection(),llvm::object::COFFObjectFile::section_begin(),llvm::object::GOFFObjectFile::section_begin(),llvm::object::MachOObjectFile::section_begin(),llvm::object::WasmObjectFile::section_begin(),llvm::object::XCOFFObjectFile::section_begin(),llvm::object::COFFObjectFile::section_end(),llvm::object::GOFFObjectFile::section_end(),llvm::object::MachOObjectFile::section_end(),llvm::object::WasmObjectFile::section_end(), andllvm::object::XCOFFObjectFile::section_end().

◆ SymbolRef

friend classSymbolRef
friend

Definition at line247 of fileObjectFile.h.

Referenced byllvm::object::COFFObjectFile::getRelocationSymbol(),llvm::object::MachOObjectFile::getRelocationSymbol(),llvm::object::WasmObjectFile::getRelocationSymbol(),llvm::object::XCOFFObjectFile::getRelocationSymbol(),llvm::object::MachOObjectFile::getSymbolByIndex(),llvm::object::COFFObjectFile::symbol_begin(),llvm::object::GOFFObjectFile::symbol_begin(),llvm::object::MachOObjectFile::symbol_begin(),llvm::object::XCOFFObjectFile::symbol_begin(),llvm::object::COFFObjectFile::symbol_end(),llvm::object::GOFFObjectFile::symbol_end(),llvm::object::MachOObjectFile::symbol_end(), andllvm::object::XCOFFObjectFile::symbol_end().


The documentation for this class was generated from the following files:

Generated on Sun Jul 20 2025 22:16:29 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp