LLVM API Documentation

Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
llvm::object::COFFObjectFile Class Reference

#include <COFF.h>

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

List of all members.

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 getNumberOfSymbols () const
 COFFObjectFile (MemoryBufferRef Object, std::error_code &EC)
basic_symbol_iterator symbol_begin_impl () const override
basic_symbol_iterator symbol_end_impl () 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
uint8_t getBytesInAddress () const override
 The number of bytes used to represent an address in this object file format.
StringRef getFileFormatName () const override
unsigned getArch () const override
import_directory_iterator import_directory_begin () const
import_directory_iterator import_directory_end () const
export_directory_iterator export_directory_begin () const
export_directory_iterator export_directory_end () 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
template<typename coff_symbol_type >
std::error_code getSymbol (uint32_t Index, const coff_symbol_type *&Res) const
ErrorOr< 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
ArrayRef< uint8_t > getSymbolAuxData (COFFSymbolRef Symbol) const
size_t getSymbolTableEntrySize () const
std::error_code getSectionName (const coff_section *Sec, StringRef &Res) const
std::error_code getSectionContents (const coff_section *Sec, ArrayRef< uint8_t > &Res) 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 getHintName (uint32_t Rva, uint16_t &Hint, StringRef &Name) const
bool isRelocatableObject () const override
 True if this is a relocatable object (.o/.obj).
template<typename coff_symbol_type >
const coff_symbol_type * toSymb (DataRefImpl Ref) const

Static Public Member Functions

static bool classof (const Binary *v)

Protected Member Functions

void moveSymbolNext (DataRefImpl &Symb) const override
std::error_code getSymbolName (DataRefImpl Symb, StringRef &Res) const override
std::error_code getSymbolAddress (DataRefImpl Symb, uint64_t &Res) const override
std::error_code getSymbolSize (DataRefImpl Symb, uint64_t &Res) const override
uint32_t getSymbolFlags (DataRefImpl Symb) const override
std::error_code getSymbolType (DataRefImpl Symb, SymbolRef::Type &Res) const override
std::error_code getSymbolSection (DataRefImpl Symb, section_iterator &Res) const override
void moveSectionNext (DataRefImpl &Sec) const override
std::error_code getSectionName (DataRefImpl Sec, StringRef &Res) const override
std::error_code getSectionAddress (DataRefImpl Sec, uint64_t &Res) const override
std::error_code getSectionSize (DataRefImpl Sec, uint64_t &Res) const override
std::error_code getSectionContents (DataRefImpl Sec, StringRef &Res) const override
std::error_code getSectionAlignment (DataRefImpl Sec, uint64_t &Res) const override
std::error_code isSectionText (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionData (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionBSS (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionVirtual (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionZeroInit (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionReadOnlyData (DataRefImpl Sec, bool &Res) const override
std::error_code isSectionRequiredForExecution (DataRefImpl Sec, bool &Res) const override
std::error_code sectionContainsSymbol (DataRefImpl Sec, DataRefImpl Symb, bool &Result) 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
std::error_code getRelocationAddress (DataRefImpl Rel, uint64_t &Res) const override
std::error_code getRelocationOffset (DataRefImpl Rel, uint64_t &Res) const override
symbol_iterator getRelocationSymbol (DataRefImpl Rel) const override
std::error_code getRelocationType (DataRefImpl Rel, uint64_t &Res) const override
std::error_code getRelocationTypeName (DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
std::error_code getRelocationValueString (DataRefImpl Rel, SmallVectorImpl< char > &Result) const override

Friends

class ImportDirectoryEntryRef
class ExportDirectoryEntryRef

Detailed Description

Definition at line 419 of file Object/COFF.h.


Constructor & Destructor Documentation

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

Member Function Documentation

static bool llvm::object::COFFObjectFile::classof ( const Binary v) [inline, static]

Reimplemented from llvm::object::ObjectFile.

Definition at line 640 of file Object/COFF.h.

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

Definition at line 663 of file COFFObjectFile.cpp.

References ExportDirectoryEntryRef.

unsigned COFFObjectFile::getArch ( ) const [override, virtual]
template<typename T >
std::error_code llvm::object::COFFObjectFile::getAuxSymbol ( uint32_t  index,
const T *&  Res 
) const [inline]

Definition at line 610 of file Object/COFF.h.

References llvm::ErrorOr< T >::getError(), getSymbol(), and llvm::object::success.

uint8_t COFFObjectFile::getBytesInAddress ( ) const [override, virtual]

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

Implements llvm::object::ObjectFile.

Definition at line 690 of file COFFObjectFile.cpp.

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

Definition at line 895 of file COFFObjectFile.cpp.

References llvm::object::SectionRef::getRawDataRefImpl().

Referenced by getRvaPtr().

std::error_code COFFObjectFile::getDataDirectory ( uint32_t  index,
const data_directory *&  Res 
) const
StringRef COFFObjectFile::getFileFormatName ( ) const [override, virtual]
std::error_code COFFObjectFile::getHintName ( uint32_t  Rva,
uint16_t &  Hint,
StringRef Name 
) const

Definition at line 470 of file COFFObjectFile.cpp.

References getRvaPtr(), and llvm::object::success.

uint16_t llvm::object::COFFObjectFile::getMachine ( ) const [inline]
std::error_code COFFObjectFile::getPE32Header ( const pe32_header *&  Res) const

Definition at line 720 of file COFFObjectFile.cpp.

References llvm::object::success.

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

Definition at line 726 of file COFFObjectFile.cpp.

References llvm::object::success.

std::error_code COFFObjectFile::getRelocationAddress ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 864 of file COFFObjectFile.cpp.

References llvm::report_fatal_error().

std::error_code COFFObjectFile::getRelocationOffset ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, protected, virtual]
symbol_iterator COFFObjectFile::getRelocationSymbol ( DataRefImpl  Rel) const [override, protected, virtual]
std::error_code COFFObjectFile::getRelocationType ( DataRefImpl  Rel,
uint64_t &  Res 
) const [override, protected, virtual]
std::error_code COFFObjectFile::getRelocationTypeName ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 922 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_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_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, llvm::object::success, and llvm::object::coff_relocation::Type.

std::error_code COFFObjectFile::getRelocationValueString ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const [override, protected, virtual]
std::error_code COFFObjectFile::getRvaPtr ( uint32_t  Rva,
uintptr_t &  Res 
) const
std::error_code COFFObjectFile::getSection ( int32_t  index,
const coff_section *&  Res 
) const
std::error_code COFFObjectFile::getSectionAddress ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, protected, virtual]
std::error_code COFFObjectFile::getSectionAlignment ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, protected, virtual]
std::error_code llvm::object::COFFObjectFile::getSectionContents ( DataRefImpl  Sec,
StringRef Res 
) const [override, protected, virtual]
std::error_code llvm::object::COFFObjectFile::getSectionContents ( const coff_section Sec,
ArrayRef< uint8_t > &  Res 
) const
std::error_code llvm::object::COFFObjectFile::getSectionName ( DataRefImpl  Sec,
StringRef Res 
) const [override, protected, virtual]
std::error_code llvm::object::COFFObjectFile::getSectionName ( const coff_section Sec,
StringRef Res 
) const
std::error_code COFFObjectFile::getSectionSize ( DataRefImpl  Sec,
uint64_t &  Res 
) const [override, protected, virtual]
template<typename coff_symbol_type >
std::error_code llvm::object::COFFObjectFile::getSymbol ( uint32_t  Index,
const coff_symbol_type *&  Res 
) const [inline]
ErrorOr<COFFSymbolRef> llvm::object::COFFObjectFile::getSymbol ( uint32_t  index) const [inline]

Definition at line 594 of file Object/COFF.h.

References getSymbol(), and llvm_unreachable.

std::error_code COFFObjectFile::getSymbolAddress ( DataRefImpl  Symb,
uint64_t &  Res 
) const [override, protected, virtual]
uint32_t COFFObjectFile::getSymbolFlags ( DataRefImpl  Symb) const [override, protected, virtual]
std::error_code llvm::object::COFFObjectFile::getSymbolName ( DataRefImpl  Symb,
StringRef Res 
) const [override, protected, virtual]
std::error_code llvm::object::COFFObjectFile::getSymbolName ( COFFSymbolRef  Symbol,
StringRef Res 
) const
std::error_code COFFObjectFile::getSymbolSection ( DataRefImpl  Symb,
section_iterator Res 
) const [override, protected, virtual]
std::error_code COFFObjectFile::getSymbolSize ( DataRefImpl  Symb,
uint64_t &  Res 
) const [override, protected, virtual]
uintptr_t llvm::object::COFFObjectFile::getSymbolTable ( ) const [inline]

Definition at line 449 of file Object/COFF.h.

Referenced by getSymbol(), and symbol_begin_impl().

Definition at line 621 of file Object/COFF.h.

References llvm_unreachable.

Referenced by getSymbolAuxData().

std::error_code COFFObjectFile::getSymbolType ( DataRefImpl  Symb,
SymbolRef::Type Res 
) const [override, protected, virtual]
std::error_code COFFObjectFile::getVaPtr ( uint64_t  VA,
uintptr_t &  Res 
) const

Definition at line 653 of file COFFObjectFile.cpp.

References ImportDirectoryEntryRef.

Definition at line 658 of file COFFObjectFile.cpp.

References ImportDirectoryEntryRef.

bool COFFObjectFile::isRelocatableObject ( ) const [override, virtual]

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

Implements llvm::object::ObjectFile.

Definition at line 1013 of file COFFObjectFile.cpp.

std::error_code COFFObjectFile::isSectionBSS ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]
std::error_code COFFObjectFile::isSectionData ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]
std::error_code COFFObjectFile::isSectionReadOnlyData ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 337 of file COFFObjectFile.cpp.

References llvm::object::success.

std::error_code COFFObjectFile::isSectionRequiredForExecution ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 316 of file COFFObjectFile.cpp.

References llvm::object::success.

std::error_code COFFObjectFile::isSectionText ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]
std::error_code COFFObjectFile::isSectionVirtual ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]
std::error_code COFFObjectFile::isSectionZeroInit ( DataRefImpl  Sec,
bool Res 
) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 330 of file COFFObjectFile.cpp.

References llvm::object::success.

void COFFObjectFile::moveRelocationNext ( DataRefImpl Rel) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 859 of file COFFObjectFile.cpp.

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

void COFFObjectFile::moveSectionNext ( DataRefImpl Sec) const [override, protected, virtual]

Implements llvm::object::ObjectFile.

Definition at line 250 of file COFFObjectFile.cpp.

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

void COFFObjectFile::moveSymbolNext ( DataRefImpl Symb) const [override, protected, virtual]
section_iterator COFFObjectFile::section_begin ( ) const [override, virtual]
section_iterator COFFObjectFile::section_end ( ) const [override, virtual]
relocation_iterator COFFObjectFile::section_rel_begin ( DataRefImpl  Sec) const [override, protected, virtual]
relocation_iterator COFFObjectFile::section_rel_end ( DataRefImpl  Sec) const [override, protected, virtual]
std::error_code COFFObjectFile::sectionContainsSymbol ( DataRefImpl  Sec,
DataRefImpl  Symb,
bool Result 
) const [override, protected, virtual]
template<typename coff_symbol_type >
const coff_symbol_type* llvm::object::COFFObjectFile::toSymb ( DataRefImpl  Ref) const

Friends And Related Function Documentation

friend class ExportDirectoryEntryRef [friend]

Definition at line 422 of file Object/COFF.h.

Referenced by export_directory_begin(), and export_directory_end().

friend class ImportDirectoryEntryRef [friend]

Definition at line 421 of file Object/COFF.h.

Referenced by import_directory_begin(), and import_directory_end().


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