llvm::object::ObjectFile

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.

Synopsis

Declared in <llvm/Object/ObjectFile.h>

class ObjectFile
    : public SymbolicFile

Base Classes

NameDescription
SymbolicFile

Type Aliases

Name
basic_symbol_iterator_range
section_iterator_range
symbol_iterator_range

Member Functions

NameDescription
ObjectFile [constructor]Constructors
operator= [deleted]ObjectFile is not copy-assignable.
dynamic_relocation_sections [virtual]
getArch [virtual]
getBytesInAddress [virtual]The number of bytes used to represent an address in this object file format.
getCommonSymbolSize
getData Returns the binary's raw buffer contents.
getFeatures [virtual]Subtarget features described by this object file.
getFileFormatName [virtual]
getFileName Returns the file name (buffer identifier) for this binary.
getMemoryBufferRef Returns a MemoryBufferRef over the binary's data.
getOS [virtual]
getStartAddress [virtual]Entry point address, or an error if the format has none.
getSymbolFlags [virtual]
getTripleObjectFormat Maps this binary's type to a Triple::ObjectFormatType.
getType
hasDebugInfo [virtual]
initContent [virtual]
is64Bit [virtual]
isArchive True if this is a static or dynamic archive.
isCOFF
isCOFFImportFile True if this is a COFF import library member.
isDXContainer
isELF
isGOFF
isIR
isLittleEndian
isMachO
isMachOUniversalBinary
isMinidump True if this is a Windows minidump.
isObject
isOffloadFile
isReflectionSectionStrippable True if the reflection section can be stripped by the linker.
isRelocatableObject [virtual]True if this is a relocatable object (.o/.obj).
isSymbolic
isTapiFile
isTapiUniversal
isWasm
isWinRes
isXCOFF
makeTriple Create a triple from the data in this object file.
mapDebugSectionName [virtual]Maps a debug section name to a standard DWARF section name.
moveSymbolNext [virtual]Advances Symb to the next symbol.
printSymbolName [virtual]
section_begin [virtual]
section_end [virtual]
sections
setARMSubArch [virtual]
symbol_begin [virtual]
symbol_end [virtual]
symbols
tryGetCPUName [virtual]

Static Member Functions

NameDescription
checkOffset
classof True if v is an ObjectFile (type ID between StartObjects and EndObjects).
createCOFFObjectFile
createDXContainerObjectFile
createELFObjectFile
createGOFFObjectFile
createMachOObjectFile
createObjectFile Create an ObjectFile from Object, autodetecting the file type.
createSymbolicFile
createWasmObjectFile
createXCOFFObjectFile
isSymbolicFile

Protected Enums

NameDescription
Unnamed enum Discriminators for concrete Binary subclasses.

Protected Member Functions

NameDescription
ObjectFile [constructor]
base
getCommonSymbolSizeImpl [virtual]Size of common symbol Symb (format-specific implementation).
getRelocatedSection [virtual]
getRelocationOffset [virtual]
getRelocationSymbol [virtual]
getRelocationType [virtual]
getRelocationTypeName [virtual]Append a display name for relocation Rel's type to Result.
getSectionAddress [virtual]
getSectionAlignment [virtual]
getSectionContents [virtual]
getSectionIndex [virtual]
getSectionName [virtual]Name of section Sec.
getSectionSize [virtual]
getSymbolAddress [virtual]
getSymbolAlignment [virtual]
getSymbolName [virtual]
getSymbolSection [virtual]
getSymbolType [virtual]
getSymbolValue
getSymbolValueImpl [virtual]
isBerkeleyData [virtual]
isBerkeleyText [virtual]
isDebugSection [virtual]
isSectionBSS [virtual]
isSectionBitcode [virtual]
isSectionCompressed [virtual]
isSectionData [virtual]True if the section contains initialized data (not text).
isSectionStripped [virtual]
isSectionText [virtual]
isSectionVirtual [virtual]
mapReflectionSectionNameToEnumValue [virtual]
moveRelocationNext [virtual]
moveSectionNext [virtual]
printSymbolName [virtual]
section_rel_begin [virtual]
section_rel_end [virtual]Past-the-end iterator for relocations in section Sec.

Protected Static Member Functions

Name
getELFType
getMachOType

Protected Data Members

Name
Data

Friends

NameDescription
llvm::object::RelocationRefThis is a value type class that represents a single relocation in the list of relocations in the object file.
llvm::object::SectionRefThis is a value type class that represents a single section in the list of sections in the object file.
llvm::object::SymbolRefThis is a value type class that represents a single symbol in the list of symbols in the object file.

Non-Member Functions

NameDescription
extractCodeObjectExtract code object memory from the given Source object file at Offset and of Size, and copy into OutputFileName.
extractOffloadBundleFatBinaryExtracts fat binary in binary clang-offload-bundler format from object Obj and return it in Bundles
getBuildIDReturns the build ID, if any, contained in the given object file.
getRelocationResolverReturns format-specific support and resolve callbacks for Obj's relocations.
::llvm::objcopy::getObjectFormatNameReturns the format name of B if it is an ObjectFile, or "" otherwise.
::llvm::remarks::getRemarksSectionContentsReturns a buffer with the contents of the remarks section depending on the format of the file. If the section doesn't exist, this returns an empty optional.
::llvm::yaml::yaml2ObjectFileConvenience function for tests.