CLRX  1
An unofficial OpenCL extensions designed for Radeon GPUs
Public Types | Public Member Functions | Protected Attributes | List of all members
CLRX::ElfBinaryTemplate< Types > Class Template Reference

ELF binary class. More...

#include <ElfBinaries.h>

Public Types

typedef Array< std::pair< const char *, size_t > > SectionIndexMap
 section index map
 
typedef Array< std::pair< const char *, size_t > > SymbolIndexMap
 symbol index map
 

Public Member Functions

 ElfBinaryTemplate (size_t binaryCodeSize, cxbyte *binaryCode, Flags creationFlags=ELF_CREATE_ALL)
 
Flags getCreationFlags () const
 get creation flags
 
bool hasSectionMap () const
 returns true if object has a section's index map
 
bool hasSymbolMap () const
 returns true if object has a symbol's index map
 
bool hasDynSymbolMap () const
 returns true if object has a dynamic symbol's index map
 
size_t getSize () const
 get size of binaries
 
 operator bool () const
 returns true if object is initialized
 
bool operator! () const
 returns true if object is uninitialized
 
const cxbyte * getBinaryCode () const
 get binary code
 
cxbyte * getBinaryCode ()
 get binary code
 
const Types::Ehdr & getHeader () const
 get ELF binary header
 
Types::Ehdr & getHeader ()
 get ELF binary header
 
uint16_t getSectionHeadersNum () const
 get section headers number
 
const Types::Shdr & getSectionHeader (uint16_t index) const
 get section header with specified index
 
Types::Shdr & getSectionHeader (uint16_t index)
 get section header with specified index
 
uint16_t getProgramHeadersNum () const
 get program headers number
 
const Types::Phdr & getProgramHeader (uint16_t index) const
 get program header with specified index
 
Types::Phdr & getProgramHeader (uint16_t index)
 get program header with specified index
 
Types::Size getSymbolsNum () const
 get symbols number
 
Types::Size getDynSymbolsNum () const
 get dynamic symbols number
 
const Types::Sym & getSymbol (typename Types::Size index) const
 get symbol with specified index
 
Types::Sym & getSymbol (typename Types::Size index)
 get symbol with specified index
 
const Types::Sym & getDynSymbol (typename Types::Size index) const
 get dynamic symbol with specified index
 
Types::Sym & getDynSymbol (typename Types::Size index)
 get dynamic symbol with specified index
 
const char * getSymbolName (typename Types::Size index) const
 get symbol name with specified index
 
const char * getDynSymbolName (typename Types::Size index) const
 get dynamic symbol name with specified index
 
const char * getSectionName (uint16_t index) const
 get section name with specified index
 
SectionIndexMap::const_iterator getSectionIterEnd () const
 get end iterator if section index map
 
SectionIndexMap::const_iterator getSectionIter (const char *name) const
 get section iterator with specified name (requires section index map)
 
uint16_t getSectionIndex (const char *name) const
 get section index with specified name
 
Types::Size getSymbolIndex (const char *name) const
 get symbol index with specified name (requires symbol index map)
 
Types::Size getDynSymbolIndex (const char *name) const
 get dynamic symbol index with specified name (requires dynamic symbol index map)
 
SymbolIndexMap::const_iterator getSymbolIterEnd () const
 get end iterator of symbol index map
 
SymbolIndexMap::const_iterator getDynSymbolIterEnd () const
 get end iterator of dynamic symbol index map
 
SymbolIndexMap::const_iterator getSymbolIter (const char *name) const
 get symbol iterator with specified name (requires symbol index map)
 
SymbolIndexMap::const_iterator getDynSymbolIter (const char *name) const
 get dynamic symbol iterator with specified name (requires dynamic symbol index map)
 
const Types::Shdr & getSectionHeader (const char *name) const
 get section header with specified name
 
Types::Shdr & getSectionHeader (const char *name)
 get section header with specified name
 
const Types::Sym & getSymbol (const char *name) const
 get symbol with specified name (requires symbol index map)
 
Types::Sym & getSymbol (const char *name)
 get symbol with specified name (requires symbol index map)
 
const Types::Sym & getDynSymbol (const char *name) const
 get dynamic symbol with specified name (requires dynamic symbol index map)
 
Types::Sym & getDynSymbol (const char *name)
 get dynamic symbol with specified name (requires dynamic symbol index map)
 
const Types::Nhdr * getNotes () const
 get note table
 
Types::Nhdr * getNotes ()
 get note table
 
Types::Size getNotesSize () const
 get size of notes in bytes
 
const Types::Size getDynamicsNum () const
 get dynamic entries number
 
const Types::Size getDynamicEntrySize () const
 get dynamic entries size
 
const Types::Dyn * getDynamicTable () const
 get dynamic table
 
Types::Dyn * getDynamicTable ()
 get dynamic table
 
const cxbyte * getSectionContent (uint16_t index) const
 get section content pointer
 
cxbyte * getSectionContent (uint16_t index)
 get section content pointer
 
const cxbyte * getSectionContent (const char *name) const
 get section content pointer
 
cxbyte * getSectionContent (const char *name)
 get section content pointer
 

Protected Attributes

Flags creationFlags
 creation flags holder
 
size_t binaryCodeSize
 binary code size
 
cxbyte * binaryCode
 pointer to binary code
 
cxbyte * sectionStringTable
 pointer to section's string table
 
cxbyte * symbolStringTable
 pointer to symbol's string table
 
cxbyte * symbolTable
 pointer to symbol table
 
cxbyte * dynSymStringTable
 pointer to dynamic symbol's string table
 
cxbyte * dynSymTable
 pointer to dynamic symbol table
 
cxbyte * noteTable
 pointer to note table
 
cxbyte * dynamicTable
 pointer to dynamic table
 
SectionIndexMap sectionIndexMap
 section's index map
 
SymbolIndexMap symbolIndexMap
 symbol's index map
 
SymbolIndexMap dynSymIndexMap
 dynamic symbol's index map
 
Types::Size symbolsNum
 symbols number
 
Types::Size dynSymbolsNum
 dynamic symbols number
 
Types::Size noteTableSize
 size of note table
 
Types::Size dynamicsNum
 get dynamic entries number
 
uint16_t symbolEntSize
 symbol entry size in a symbol's table
 
uint16_t dynSymEntSize
 dynamic symbol entry size in a dynamic symbol's table
 
Types::Size dynamicEntSize
 get dynamic entry size
 

Detailed Description

template<typename Types>
class CLRX::ElfBinaryTemplate< Types >

ELF binary class.

This object doesn't copy binary code content. Only it takes and uses a binary code.

Constructor & Destructor Documentation

template<typename Types>
CLRX::ElfBinaryTemplate< Types >::ElfBinaryTemplate ( size_t  binaryCodeSize,
cxbyte *  binaryCode,
Flags  creationFlags = ELF_CREATE_ALL 
)

constructor.

Parameters
binaryCodeSizebinary code size
binaryCodepointer to binary code
creationFlagsflags that specified what will be created during creation

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