LLVM  8.0.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::object::COFFObjectFile Class Reference

#include "llvm/Object/COFF.h"

Inheritance diagram for llvm::object::COFFObjectFile:
Inheritance graph
[legend]
Collaboration diagram for llvm::object::COFFObjectFile:
Collaboration graph
[legend]

Public Member Functions

uintptr_t getSymbolTable () const
 
uint16_t getMachine () const
 
uint16_t getSizeOfOptionalHeader () const
 
uint16_t getCharacteristics () const
 
uint32_t getTimeDateStamp () const
 
uint32_t getNumberOfSections () const
 
uint32_t getPointerToSymbolTable () const
 
uint32_t getRawNumberOfSymbols () const
 
uint32_t getNumberOfSymbols () const
 
const coff_load_configuration32getLoadConfig32 () const
 
const coff_load_configuration64getLoadConfig64 () const
 
StringRef getRelocationTypeName (uint16_t Type) const
 
 COFFObjectFile (MemoryBufferRef Object, std::error_code &EC)
 
basic_symbol_iterator symbol_begin () const override
 
basic_symbol_iterator symbol_end () const override
 
section_iterator section_begin () const override
 
section_iterator section_end () const override
 
const coff_sectiongetCOFFSection (const SectionRef &Section) const
 
COFFSymbolRef getCOFFSymbol (const DataRefImpl &Ref) const
 
COFFSymbolRef getCOFFSymbol (const SymbolRef &Symbol) const
 
const coff_relocationgetCOFFRelocation (const RelocationRef &Reloc) const
 
unsigned getSectionID (SectionRef Sec) const
 
unsigned getSymbolSectionID (SymbolRef Sym) const
 
uint8_t getBytesInAddress () const override
 The number of bytes used to represent an address in this object file format. More...
 
StringRef getFileFormatName () const override
 
Triple::ArchType getArch () const override
 
Expected< uint64_t > getStartAddress () const override
 
SubtargetFeatures getFeatures () const override
 
import_directory_iterator import_directory_begin () const
 
import_directory_iterator import_directory_end () const
 
delay_import_directory_iterator delay_import_directory_begin () const
 
delay_import_directory_iterator delay_import_directory_end () const
 
export_directory_iterator export_directory_begin () const
 
export_directory_iterator export_directory_end () const
 
base_reloc_iterator base_reloc_begin () const
 
base_reloc_iterator base_reloc_end () const
 
const debug_directorydebug_directory_begin () const
 
const debug_directorydebug_directory_end () const
 
iterator_range< import_directory_iteratorimport_directories () const
 
iterator_range< delay_import_directory_iteratordelay_import_directories () const
 
iterator_range< export_directory_iteratorexport_directories () const
 
iterator_range< base_reloc_iteratorbase_relocs () const
 
iterator_range< const debug_directory * > debug_directories () const
 
const dos_headergetDOSHeader () const
 
std::error_code getCOFFHeader (const coff_file_header *&Res) const
 
std::error_code getCOFFBigObjHeader (const coff_bigobj_file_header *&Res) const
 
std::error_code getPE32Header (const pe32_header *&Res) const
 
std::error_code getPE32PlusHeader (const pe32plus_header *&Res) const
 
std::error_code getDataDirectory (uint32_t index, const data_directory *&Res) const
 
std::error_code getSection (int32_t index, const coff_section *&Res) const
 
std::error_code getSection (StringRef SectionName, const coff_section *&Res) const
 
template<typename coff_symbol_type >
std::error_code getSymbol (uint32_t Index, const coff_symbol_type *&Res) const
 
Expected< COFFSymbolRefgetSymbol (uint32_t index) const
 
template<typename T >
std::error_code getAuxSymbol (uint32_t index, const T *&Res) const
 
std::error_code getSymbolName (COFFSymbolRef Symbol, StringRef &Res) const
 
std::error_code getSymbolName (const coff_symbol_generic *Symbol, StringRef &Res) const
 
ArrayRef< uint8_t > getSymbolAuxData (COFFSymbolRef Symbol) const
 
uint32_t getSymbolIndex (COFFSymbolRef Symbol) const
 
size_t getSymbolTableEntrySize () const
 
ArrayRef< coff_relocationgetRelocations (const coff_section *Sec) const
 
std::error_code getSectionName (const coff_section *Sec, StringRef &Res) const
 
uint64_t getSectionSize (const coff_section *Sec) const
 
std::error_code getSectionContents (const coff_section *Sec, ArrayRef< uint8_t > &Res) const
 
uint64_t getImageBase () const
 
std::error_code getVaPtr (uint64_t VA, uintptr_t &Res) const
 
std::error_code getRvaPtr (uint32_t Rva, uintptr_t &Res) const
 
std::error_code getRvaAndSizeAsBytes (uint32_t RVA, uint32_t Size, ArrayRef< uint8_t > &Contents) const
 Given an RVA base and size, returns a valid array of bytes or an error code if the RVA and size is not contained completely within a valid section. More...
 
std::error_code getHintName (uint32_t Rva, uint16_t &Hint, StringRef &Name) const
 
std::error_code getDebugPDBInfo (const debug_directory *DebugDir, const codeview::DebugInfo *&Info, StringRef &PDBFileName) const
 Get PDB information out of a codeview debug directory entry. More...
 
std::error_code getDebugPDBInfo (const codeview::DebugInfo *&Info, StringRef &PDBFileName) const
 Get PDB information from an executable. More...
 
bool isRelocatableObject () const override
 True if this is a relocatable object (.o/.obj). More...
 
bool is64 () const
 
StringRef mapDebugSectionName (StringRef Name) const override
 Maps a debug section name to a standard DWARF section name. More...
 
template<typename coff_symbol_type >
const coff_symbol_type * toSymb (DataRefImpl Ref) const
 
- Public Member Functions inherited from llvm::object::ObjectFile
 ObjectFile ()=delete
 
 ObjectFile (const ObjectFile &other)=delete
 
uint64_t getCommonSymbolSize (DataRefImpl Symb) const
 
virtual std::vector< SectionRefdynamic_relocation_sections () const
 
symbol_iterator_range symbols () const
 
section_iterator_range sections () const
 
virtual void setARMSubArch (Triple &TheTriple) const
 
Triple makeTriple () const
 Create a triple from the data in this object file. More...
 
virtual std::error_code getBuildAttributes (ARMAttributeParser &Attributes) const
 
- Public Member Functions inherited from llvm::object::SymbolicFile
 SymbolicFile (unsigned int Type, MemoryBufferRef Source)
 
 ~SymbolicFile () override
 
basic_symbol_iterator_range symbols () const
 
- Public Member Functions inherited from llvm::object::Binary
 Binary ()=delete
 
 Binary (const Binary &other)=delete
 
virtual ~Binary ()
 
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 isELF () const
 
bool isMachO () const
 
bool isCOFF () const
 
bool isWasm () const
 
bool isCOFFImportFile () const
 
bool isIR () const
 
bool isLittleEndian () const
 
bool isWinRes () const
 
Triple::ObjectFormatType getTripleObjectFormat () const
 

Static Public Member Functions

static bool classof (const Binary *v)
 
- Static Public Member Functions inherited from llvm::object::ObjectFile
static Expected< OwningBinary< ObjectFile > > createObjectFile (StringRef ObjectPath)
 
static Expected< std::unique_ptr< ObjectFile > > createObjectFile (MemoryBufferRef Object, llvm::file_magic Type)
 
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 > > createELFObjectFile (MemoryBufferRef Object)
 
static Expected< std::unique_ptr< MachOObjectFile > > createMachOObjectFile (MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0)
 
static Expected< std::unique_ptr< WasmObjectFile > > createWasmObjectFile (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)
 
static Expected< std::unique_ptr< SymbolicFile > > createSymbolicFile (MemoryBufferRef Object)
 
static Expected< OwningBinary< SymbolicFile > > createSymbolicFile (StringRef ObjectPath)
 
static bool classof (const Binary *v)
 
- Static Public Member Functions inherited from llvm::object::Binary
static std::error_code checkOffset (MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)
 

Protected Member Functions

void moveSymbolNext (DataRefImpl &Symb) const override
 
Expected< StringRefgetSymbolName (DataRefImpl Symb) const override
 
Expected< uint64_t > getSymbolAddress (DataRefImpl Symb) const override
 
uint32_t getSymbolAlignment (DataRefImpl Symb) const override
 
uint64_t getSymbolValueImpl (DataRefImpl Symb) const override
 
uint64_t getCommonSymbolSizeImpl (DataRefImpl Symb) const override
 
uint32_t getSymbolFlags (DataRefImpl Symb) const override
 
Expected< SymbolRef::TypegetSymbolType (DataRefImpl Symb) const override
 
Expected< section_iteratorgetSymbolSection (DataRefImpl Symb) const override
 
void moveSectionNext (DataRefImpl &Sec) const override
 
std::error_code getSectionName (DataRefImpl Sec, StringRef &Res) const override
 
uint64_t getSectionAddress (DataRefImpl Sec) const override
 
uint64_t getSectionIndex (DataRefImpl Sec) const override
 
uint64_t getSectionSize (DataRefImpl Sec) const override
 
std::error_code getSectionContents (DataRefImpl Sec, StringRef &Res) const override
 
uint64_t getSectionAlignment (DataRefImpl Sec) const override
 
bool isSectionCompressed (DataRefImpl Sec) const override
 
bool isSectionText (DataRefImpl Sec) const override
 
bool isSectionData (DataRefImpl Sec) const override
 
bool isSectionBSS (DataRefImpl Sec) const override
 
bool isSectionVirtual (DataRefImpl Sec) const override
 
relocation_iterator section_rel_begin (DataRefImpl Sec) const override
 
relocation_iterator section_rel_end (DataRefImpl Sec) const override
 
void moveRelocationNext (DataRefImpl &Rel) const override
 
uint64_t getRelocationOffset (DataRefImpl Rel) const override
 
symbol_iterator getRelocationSymbol (DataRefImpl Rel) const override
 
uint64_t getRelocationType (DataRefImpl Rel) const override
 
void getRelocationTypeName (DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
 
- Protected Member Functions inherited from llvm::object::ObjectFile
 ObjectFile (unsigned int Type, MemoryBufferRef Source)
 
const uint8_t * base () const
 
std::error_code printSymbolName (raw_ostream &OS, DataRefImpl Symb) const override
 
virtual bool isSectionBitcode (DataRefImpl Sec) const
 
virtual bool isSectionStripped (DataRefImpl Sec) const
 
virtual bool isBerkeleyText (DataRefImpl Sec) const
 
virtual bool isBerkeleyData (DataRefImpl Sec) const
 
virtual section_iterator getRelocatedSection (DataRefImpl Sec) const
 
uint64_t getSymbolValue (DataRefImpl Symb) const
 
- Protected Member Functions inherited from llvm::object::Binary
 Binary (unsigned int Type, MemoryBufferRef Source)
 

Friends

class ImportDirectoryEntryRef
 
class ExportDirectoryEntryRef
 

Additional Inherited Members

- Public Types inherited from llvm::object::ObjectFile
using symbol_iterator_range = iterator_range< symbol_iterator >
 
using section_iterator_range = iterator_range< section_iterator >
 
- Public Types inherited from llvm::object::SymbolicFile
using basic_symbol_iterator_range = iterator_range< basic_symbol_iterator >
 
- Protected Types inherited from llvm::object::Binary
enum  {
  ID_Archive, ID_MachOUniversalBinary, ID_COFFImportFile, ID_IR,
  ID_WinRes, ID_StartObjects, ID_COFF, ID_ELF32L,
  ID_ELF32B, ID_ELF64L, ID_ELF64B, ID_MachO32L,
  ID_MachO32B, ID_MachO64L, ID_MachO64B, ID_Wasm,
  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
 

Detailed Description

Definition at line 763 of file COFF.h.

Constructor & Destructor Documentation

◆ COFFObjectFile()

COFFObjectFile::COFFObjectFile ( MemoryBufferRef  Object,
std::error_code &  EC 
)

Member Function Documentation

◆ base_reloc_begin()

base_reloc_iterator COFFObjectFile::base_reloc_begin ( ) const

Definition at line 873 of file COFFObjectFile.cpp.

Referenced by base_relocs().

◆ base_reloc_end()

base_reloc_iterator COFFObjectFile::base_reloc_end ( ) const

Definition at line 877 of file COFFObjectFile.cpp.

Referenced by base_relocs().

◆ base_relocs()

iterator_range< base_reloc_iterator > COFFObjectFile::base_relocs ( ) const

Definition at line 937 of file COFFObjectFile.cpp.

References base_reloc_begin(), base_reloc_end(), and llvm::make_range().

◆ classof()

static bool llvm::object::COFFObjectFile::classof ( const Binary v)
inlinestatic

Definition at line 1072 of file COFF.h.

References llvm::object::Binary::isCOFF().

◆ debug_directories()

iterator_range<const debug_directory *> llvm::object::COFFObjectFile::debug_directories ( ) const
inline

Definition at line 965 of file COFF.h.

References llvm::make_range().

Referenced by getHintName().

◆ debug_directory_begin()

const debug_directory* llvm::object::COFFObjectFile::debug_directory_begin ( ) const
inline

Definition at line 953 of file COFF.h.

◆ debug_directory_end()

const debug_directory* llvm::object::COFFObjectFile::debug_directory_end ( ) const
inline

Definition at line 956 of file COFF.h.

◆ delay_import_directories()

iterator_range< delay_import_directory_iterator > COFFObjectFile::delay_import_directories ( ) const

◆ delay_import_directory_begin()

delay_import_directory_iterator COFFObjectFile::delay_import_directory_begin ( ) const

Definition at line 834 of file COFFObjectFile.cpp.

Referenced by delay_import_directories().

◆ delay_import_directory_end()

delay_import_directory_iterator COFFObjectFile::delay_import_directory_end ( ) const

Definition at line 840 of file COFFObjectFile.cpp.

Referenced by delay_import_directories().

◆ export_directories()

iterator_range< export_directory_iterator > COFFObjectFile::export_directories ( ) const

◆ export_directory_begin()

export_directory_iterator COFFObjectFile::export_directory_begin ( ) const

Definition at line 846 of file COFFObjectFile.cpp.

References ExportDirectoryEntryRef.

Referenced by export_directories().

◆ export_directory_end()

export_directory_iterator COFFObjectFile::export_directory_end ( ) const

◆ getArch()

Triple::ArchType COFFObjectFile::getArch ( ) const
overridevirtual

◆ getAuxSymbol()

template<typename T >
std::error_code llvm::object::COFFObjectFile::getAuxSymbol ( uint32_t  index,
const T *&  Res 
) const
inline

◆ getBytesInAddress()

uint8_t COFFObjectFile::getBytesInAddress ( ) const
overridevirtual

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

Implements llvm::object::ObjectFile.

Definition at line 881 of file COFFObjectFile.cpp.

References llvm::Triple::aarch64, getArch(), and llvm::Triple::x86_64.

◆ getCharacteristics()

uint16_t llvm::object::COFFObjectFile::getCharacteristics ( ) const
inline

◆ getCOFFBigObjHeader()

std::error_code COFFObjectFile::getCOFFBigObjHeader ( const coff_bigobj_file_header *&  Res) const

Definition at line 948 of file COFFObjectFile.cpp.

◆ getCOFFHeader()

std::error_code COFFObjectFile::getCOFFHeader ( const coff_file_header *&  Res) const

Definition at line 942 of file COFFObjectFile.cpp.

◆ getCOFFRelocation()

const coff_relocation * COFFObjectFile::getCOFFRelocation ( const RelocationRef Reloc) const

◆ getCOFFSection()

const coff_section * COFFObjectFile::getCOFFSection ( const SectionRef Section) const

◆ getCOFFSymbol() [1/2]

COFFSymbolRef COFFObjectFile::getCOFFSymbol ( const DataRefImpl Ref) const

◆ getCOFFSymbol() [2/2]

COFFSymbolRef COFFObjectFile::getCOFFSymbol ( const SymbolRef Symbol) const

◆ getCommonSymbolSizeImpl()

uint64_t COFFObjectFile::getCommonSymbolSizeImpl ( DataRefImpl  Symb) const
overrideprotectedvirtual

◆ getDataDirectory()

std::error_code COFFObjectFile::getDataDirectory ( uint32_t  index,
const data_directory *&  Res 
) const

◆ getDebugPDBInfo() [1/2]

std::error_code llvm::object::COFFObjectFile::getDebugPDBInfo ( const debug_directory DebugDir,
const codeview::DebugInfo *&  Info,
StringRef PDBFileName 
) const

Get PDB information out of a codeview debug directory entry.

Referenced by getHintName().

◆ getDebugPDBInfo() [2/2]

std::error_code llvm::object::COFFObjectFile::getDebugPDBInfo ( const codeview::DebugInfo *&  Info,
StringRef PDBFileName 
) const

Get PDB information from an executable.

If the information is not present, Info will be set to nullptr and PDBFileName will be empty. An error is returned only on corrupt object files. Convenience accessor that can be used if the debug directory is not already handy.

◆ getDOSHeader()

const dos_header* llvm::object::COFFObjectFile::getDOSHeader ( ) const
inline

Definition at line 969 of file COFF.h.

References llvm::object::getSection().

Referenced by getSectionSize().

◆ getFeatures()

SubtargetFeatures llvm::object::COFFObjectFile::getFeatures ( ) const
inlineoverridevirtual

Implements llvm::object::ObjectFile.

Definition at line 943 of file COFF.h.

◆ getFileFormatName()

StringRef COFFObjectFile::getFileFormatName ( ) const
overridevirtual

◆ getHintName()

std::error_code COFFObjectFile::getHintName ( uint32_t  Rva,
uint16_t &  Hint,
StringRef Name 
) const

◆ getImageBase()

uint64_t COFFObjectFile::getImageBase ( ) const

◆ getLoadConfig32()

const coff_load_configuration32* llvm::object::COFFObjectFile::getLoadConfig32 ( ) const
inline

Definition at line 879 of file COFF.h.

References assert().

◆ getLoadConfig64()

const coff_load_configuration64* llvm::object::COFFObjectFile::getLoadConfig64 ( ) const
inline

◆ getMachine()

uint16_t llvm::object::COFFObjectFile::getMachine ( ) const
inline

◆ getNumberOfSections()

uint32_t llvm::object::COFFObjectFile::getNumberOfSections ( ) const
inline

◆ getNumberOfSymbols()

uint32_t llvm::object::COFFObjectFile::getNumberOfSymbols ( ) const
inline

◆ getPE32Header()

std::error_code COFFObjectFile::getPE32Header ( const pe32_header *&  Res) const

Definition at line 953 of file COFFObjectFile.cpp.

◆ getPE32PlusHeader()

std::error_code COFFObjectFile::getPE32PlusHeader ( const pe32plus_header *&  Res) const

Definition at line 959 of file COFFObjectFile.cpp.

◆ getPointerToSymbolTable()

uint32_t llvm::object::COFFObjectFile::getPointerToSymbolTable ( ) const
inline

◆ getRawNumberOfSymbols()

uint32_t llvm::object::COFFObjectFile::getRawNumberOfSymbols ( ) const
inline

◆ getRelocationOffset()

uint64_t COFFObjectFile::getRelocationOffset ( DataRefImpl  Rel) const
overrideprotectedvirtual

◆ getRelocations()

ArrayRef< coff_relocation > COFFObjectFile::getRelocations ( const coff_section Sec) const

◆ getRelocationSymbol()

symbol_iterator COFFObjectFile::getRelocationSymbol ( DataRefImpl  Rel) const
overrideprotectedvirtual

◆ getRelocationType()

uint64_t COFFObjectFile::getRelocationType ( DataRefImpl  Rel) const
overrideprotectedvirtual

Implements llvm::object::ObjectFile.

Definition at line 1168 of file COFFObjectFile.cpp.

References llvm::object::coff_relocation::Type.

◆ getRelocationTypeName() [1/2]

StringRef COFFObjectFile::getRelocationTypeName ( uint16_t  Type) const

Definition at line 1205 of file COFFObjectFile.cpp.

References llvm::SmallVectorImpl< T >::append(), llvm::StringRef::begin(), llvm::StringRef::end(), getMachine(), llvm::COFF::IMAGE_FILE_MACHINE_AMD64, llvm::COFF::IMAGE_FILE_MACHINE_ARM64, llvm::COFF::IMAGE_FILE_MACHINE_ARMNT, llvm::COFF::IMAGE_FILE_MACHINE_I386, llvm::COFF::IMAGE_REL_AMD64_ABSOLUTE, llvm::COFF::IMAGE_REL_AMD64_ADDR32, llvm::COFF::IMAGE_REL_AMD64_ADDR32NB, llvm::COFF::IMAGE_REL_AMD64_ADDR64, llvm::COFF::IMAGE_REL_AMD64_PAIR, llvm::COFF::IMAGE_REL_AMD64_REL32, llvm::COFF::IMAGE_REL_AMD64_REL32_1, llvm::COFF::IMAGE_REL_AMD64_REL32_2, llvm::COFF::IMAGE_REL_AMD64_REL32_3, llvm::COFF::IMAGE_REL_AMD64_REL32_4, llvm::COFF::IMAGE_REL_AMD64_REL32_5, llvm::COFF::IMAGE_REL_AMD64_SECREL, llvm::COFF::IMAGE_REL_AMD64_SECREL7, llvm::COFF::IMAGE_REL_AMD64_SECTION, llvm::COFF::IMAGE_REL_AMD64_SREL32, llvm::COFF::IMAGE_REL_AMD64_SSPAN32, llvm::COFF::IMAGE_REL_AMD64_TOKEN, llvm::COFF::IMAGE_REL_ARM64_ABSOLUTE, llvm::COFF::IMAGE_REL_ARM64_ADDR32, llvm::COFF::IMAGE_REL_ARM64_ADDR32NB, llvm::COFF::IMAGE_REL_ARM64_ADDR64, llvm::COFF::IMAGE_REL_ARM64_BRANCH14, llvm::COFF::IMAGE_REL_ARM64_BRANCH19, llvm::COFF::IMAGE_REL_ARM64_BRANCH26, llvm::COFF::IMAGE_REL_ARM64_PAGEBASE_REL21, llvm::COFF::IMAGE_REL_ARM64_PAGEOFFSET_12A, llvm::COFF::IMAGE_REL_ARM64_PAGEOFFSET_12L, llvm::COFF::IMAGE_REL_ARM64_REL21, llvm::COFF::IMAGE_REL_ARM64_SECREL, llvm::COFF::IMAGE_REL_ARM64_SECREL_HIGH12A, llvm::COFF::IMAGE_REL_ARM64_SECREL_LOW12A, llvm::COFF::IMAGE_REL_ARM64_SECREL_LOW12L, llvm::COFF::IMAGE_REL_ARM64_SECTION, llvm::COFF::IMAGE_REL_ARM64_TOKEN, llvm::COFF::IMAGE_REL_ARM_ABSOLUTE, llvm::COFF::IMAGE_REL_ARM_ADDR32, llvm::COFF::IMAGE_REL_ARM_ADDR32NB, llvm::COFF::IMAGE_REL_ARM_BLX11, llvm::COFF::IMAGE_REL_ARM_BLX23T, llvm::COFF::IMAGE_REL_ARM_BLX24, llvm::COFF::IMAGE_REL_ARM_BRANCH11, llvm::COFF::IMAGE_REL_ARM_BRANCH20T, llvm::COFF::IMAGE_REL_ARM_BRANCH24, llvm::COFF::IMAGE_REL_ARM_BRANCH24T, llvm::COFF::IMAGE_REL_ARM_MOV32A, llvm::COFF::IMAGE_REL_ARM_MOV32T, llvm::COFF::IMAGE_REL_ARM_SECREL, llvm::COFF::IMAGE_REL_ARM_SECTION, llvm::COFF::IMAGE_REL_ARM_TOKEN, llvm::COFF::IMAGE_REL_I386_ABSOLUTE, llvm::COFF::IMAGE_REL_I386_DIR16, llvm::COFF::IMAGE_REL_I386_DIR32, llvm::COFF::IMAGE_REL_I386_DIR32NB, llvm::COFF::IMAGE_REL_I386_REL16, llvm::COFF::IMAGE_REL_I386_REL32, llvm::COFF::IMAGE_REL_I386_SECREL, llvm::COFF::IMAGE_REL_I386_SECREL7, llvm::COFF::IMAGE_REL_I386_SECTION, llvm::COFF::IMAGE_REL_I386_SEG12, llvm::COFF::IMAGE_REL_I386_TOKEN, LLVM_COFF_SWITCH_RELOC_TYPE_NAME, and llvm::object::coff_relocation::Type.

◆ getRelocationTypeName() [2/2]

void llvm::object::COFFObjectFile::getRelocationTypeName ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const
overrideprotectedvirtual

◆ getRvaAndSizeAsBytes()

std::error_code COFFObjectFile::getRvaAndSizeAsBytes ( uint32_t  RVA,
uint32_t  Size,
ArrayRef< uint8_t > &  Contents 
) const

Given an RVA base and size, returns a valid array of bytes or an error code if the RVA and size is not contained completely within a valid section.

Definition at line 474 of file COFFObjectFile.cpp.

References llvm::object::ObjectFile::base(), getCOFFSection(), llvm::object::parse_failed, llvm::object::coff_section::PointerToRawData, llvm::ARMBuildAttrs::Section, llvm::object::ObjectFile::sections(), and llvm::object::coff_section::VirtualAddress.

Referenced by getHintName().

◆ getRvaPtr()

std::error_code COFFObjectFile::getRvaPtr ( uint32_t  Rva,
uintptr_t &  Res 
) const

◆ getSection() [1/2]

std::error_code llvm::object::COFFObjectFile::getSection ( int32_t  index,
const coff_section *&  Res 
) const

◆ getSection() [2/2]

std::error_code llvm::object::COFFObjectFile::getSection ( StringRef  SectionName,
const coff_section *&  Res 
) const

◆ getSectionAddress()

uint64_t COFFObjectFile::getSectionAddress ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ getSectionAlignment()

uint64_t COFFObjectFile::getSectionAlignment ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ getSectionContents() [1/2]

std::error_code llvm::object::COFFObjectFile::getSectionContents ( DataRefImpl  Sec,
StringRef Res 
) const
overrideprotectedvirtual

Implements llvm::object::ObjectFile.

Referenced by getSectionIndex().

◆ getSectionContents() [2/2]

std::error_code COFFObjectFile::getSectionContents ( const coff_section Sec,
ArrayRef< uint8_t > &  Res 
) const

◆ getSectionID()

unsigned COFFObjectFile::getSectionID ( SectionRef  Sec) const

◆ getSectionIndex()

uint64_t COFFObjectFile::getSectionIndex ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ getSectionName() [1/2]

std::error_code llvm::object::COFFObjectFile::getSectionName ( DataRefImpl  Sec,
StringRef Res 
) const
overrideprotectedvirtual

Implements llvm::object::ObjectFile.

Referenced by moveSectionNext().

◆ getSectionName() [2/2]

std::error_code COFFObjectFile::getSectionName ( const coff_section Sec,
StringRef Res 
) const

◆ getSectionSize() [1/2]

uint64_t llvm::object::COFFObjectFile::getSectionSize ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ getSectionSize() [2/2]

uint64_t COFFObjectFile::getSectionSize ( const coff_section Sec) const

◆ getSizeOfOptionalHeader()

uint16_t llvm::object::COFFObjectFile::getSizeOfOptionalHeader ( ) const
inline

◆ getStartAddress()

Expected< uint64_t > COFFObjectFile::getStartAddress ( ) const
overridevirtual

Reimplemented from llvm::object::ObjectFile.

Definition at line 915 of file COFFObjectFile.cpp.

References llvm::object::pe32_header::AddressOfEntryPoint.

◆ getSymbol() [1/2]

template<typename coff_symbol_type >
std::error_code llvm::object::COFFObjectFile::getSymbol ( uint32_t  Index,
const coff_symbol_type *&  Res 
) const
inline

Definition at line 986 of file COFF.h.

References llvm::object::parse_failed.

◆ getSymbol() [2/2]

Expected<COFFSymbolRef> llvm::object::COFFObjectFile::getSymbol ( uint32_t  index) const
inline

◆ getSymbolAddress()

Expected< uint64_t > COFFObjectFile::getSymbolAddress ( DataRefImpl  Symb) const
overrideprotectedvirtual

◆ getSymbolAlignment()

uint32_t COFFObjectFile::getSymbolAlignment ( DataRefImpl  Symb) const
overrideprotectedvirtual

◆ getSymbolAuxData()

ArrayRef< uint8_t > COFFObjectFile::getSymbolAuxData ( COFFSymbolRef  Symbol) const

◆ getSymbolFlags()

uint32_t COFFObjectFile::getSymbolFlags ( DataRefImpl  Symb) const
overrideprotectedvirtual

◆ getSymbolIndex()

uint32_t COFFObjectFile::getSymbolIndex ( COFFSymbolRef  Symbol) const

◆ getSymbolName() [1/3]

Expected<StringRef> llvm::object::COFFObjectFile::getSymbolName ( DataRefImpl  Symb) const
overrideprotectedvirtual

Implements llvm::object::ObjectFile.

Referenced by getSymbolName().

◆ getSymbolName() [2/3]

std::error_code COFFObjectFile::getSymbolName ( COFFSymbolRef  Symbol,
StringRef Res 
) const

◆ getSymbolName() [3/3]

std::error_code COFFObjectFile::getSymbolName ( const coff_symbol_generic Symbol,
StringRef Res 
) const

◆ getSymbolSection()

Expected< section_iterator > COFFObjectFile::getSymbolSection ( DataRefImpl  Symb) const
overrideprotectedvirtual

◆ getSymbolSectionID()

unsigned COFFObjectFile::getSymbolSectionID ( SymbolRef  Sym) const

◆ getSymbolTable()

uintptr_t llvm::object::COFFObjectFile::getSymbolTable ( ) const
inline

Definition at line 804 of file COFF.h.

Referenced by getSymbolIndex(), and symbol_begin().

◆ getSymbolTableEntrySize()

size_t llvm::object::COFFObjectFile::getSymbolTableEntrySize ( ) const
inline

Definition at line 1027 of file COFF.h.

References Info, llvm_unreachable, Name, and Size.

Referenced by getSymbolAuxData(), getSymbolIndex(), and section_rel_end().

◆ getSymbolType()

Expected< SymbolRef::Type > COFFObjectFile::getSymbolType ( DataRefImpl  Symb) const
overrideprotectedvirtual

◆ getSymbolValueImpl()

uint64_t COFFObjectFile::getSymbolValueImpl ( DataRefImpl  Symb) const
overrideprotectedvirtual

◆ getTimeDateStamp()

uint32_t llvm::object::COFFObjectFile::getTimeDateStamp ( ) const
inline

◆ getVaPtr()

std::error_code COFFObjectFile::getVaPtr ( uint64_t  VA,
uintptr_t &  Res 
) const

Definition at line 451 of file COFFObjectFile.cpp.

References assert(), getImageBase(), and getRvaPtr().

◆ import_directories()

iterator_range< import_directory_iterator > COFFObjectFile::import_directories ( ) const

◆ import_directory_begin()

import_directory_iterator COFFObjectFile::import_directory_begin ( ) const

◆ import_directory_end()

import_directory_iterator COFFObjectFile::import_directory_end ( ) const

Definition at line 828 of file COFFObjectFile.cpp.

References ImportDirectoryEntryRef.

Referenced by import_directories(), and import_directory_begin().

◆ is64()

bool llvm::object::COFFObjectFile::is64 ( ) const
inline

Definition at line 1068 of file COFF.h.

◆ isRelocatableObject()

bool COFFObjectFile::isRelocatableObject ( ) const
overridevirtual

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

Implements llvm::object::ObjectFile.

Definition at line 1305 of file COFFObjectFile.cpp.

◆ isSectionBSS()

bool COFFObjectFile::isSectionBSS ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ isSectionCompressed()

bool COFFObjectFile::isSectionCompressed ( DataRefImpl  Sec) const
overrideprotectedvirtual

Implements llvm::object::ObjectFile.

Definition at line 311 of file COFFObjectFile.cpp.

◆ isSectionData()

bool COFFObjectFile::isSectionData ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ isSectionText()

bool COFFObjectFile::isSectionText ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ isSectionVirtual()

bool COFFObjectFile::isSectionVirtual ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ mapDebugSectionName()

StringRef COFFObjectFile::mapDebugSectionName ( StringRef  Name) const
overridevirtual

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

Reimplemented from llvm::object::ObjectFile.

Definition at line 1309 of file COFFObjectFile.cpp.

References llvm::StringSwitch< T, R >::Default(), Name, and llvm::object::ImportDirectoryEntryRef::operator==().

◆ moveRelocationNext()

void COFFObjectFile::moveRelocationNext ( DataRefImpl Rel) const
overrideprotectedvirtual

Implements llvm::object::ObjectFile.

Definition at line 1144 of file COFFObjectFile.cpp.

References llvm::object::DataRefImpl::p.

◆ moveSectionNext()

void COFFObjectFile::moveSectionNext ( DataRefImpl Sec) const
overrideprotectedvirtual

Implements llvm::object::ObjectFile.

Definition at line 267 of file COFFObjectFile.cpp.

References getSectionName(), and llvm::object::DataRefImpl::p.

◆ moveSymbolNext()

void COFFObjectFile::moveSymbolNext ( DataRefImpl Symb) const
overrideprotectedvirtual

Implements llvm::object::SymbolicFile.

Definition at line 135 of file COFFObjectFile.cpp.

◆ section_begin()

section_iterator COFFObjectFile::section_begin ( ) const
overridevirtual

◆ section_end()

section_iterator COFFObjectFile::section_end ( ) const
overridevirtual

◆ section_rel_begin()

relocation_iterator COFFObjectFile::section_rel_begin ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ section_rel_end()

relocation_iterator COFFObjectFile::section_rel_end ( DataRefImpl  Sec) const
overrideprotectedvirtual

◆ symbol_begin()

basic_symbol_iterator COFFObjectFile::symbol_begin ( ) const
overridevirtual

◆ symbol_end()

basic_symbol_iterator COFFObjectFile::symbol_end ( ) const
overridevirtual

◆ toSymb()

template<typename coff_symbol_type >
const coff_symbol_type* llvm::object::COFFObjectFile::toSymb ( DataRefImpl  Ref) const

Friends And Related Function Documentation

◆ ExportDirectoryEntryRef

friend class ExportDirectoryEntryRef
friend

Definition at line 766 of file COFF.h.

Referenced by export_directory_begin(), and export_directory_end().

◆ ImportDirectoryEntryRef

friend class ImportDirectoryEntryRef
friend

Definition at line 765 of file COFF.h.

Referenced by import_directory_begin(), and import_directory_end().


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