retdec
Private Types | Private Attributes | List of all members
retdec::fileformat::RelocationTable Class Reference

#include <relocation_table.h>

Collaboration diagram for retdec::fileformat::RelocationTable:
Collaboration graph
[legend]

Public Member Functions

Getters
std::size_t getNumberOfRelocations () const
 
const RelocationgetRelocation (std::size_t relocationIndex) const
 
const RelocationgetRelocation (const std::string &name) const
 
const RelocationgetRelocationOnAddress (unsigned long long addr) const
 
unsigned long long getLinkToSymbolTable () const
 
Setters
void setLinkToSymbolTable (std::uint64_t symbolTableIndex)
 
Iterators
relocationsIterator begin () const
 
relocationsIterator end () const
 
Other methods
void clear ()
 
void addRelocation (Relocation &relocation)
 
bool hasRelocations () const
 
bool hasRelocation (const std::string &name) const
 
bool hasRelocation (unsigned long long addr) const
 
void dump (std::string &dumpTable) const
 

Private Types

using relocationsIterator = std::vector< Relocation >::const_iterator
 

Private Attributes

std::vector< Relocationtable
 stored relocations More...
 
unsigned long long linkToSymbolTable
 link to associated symbol table More...
 

Detailed Description

Class for relocation table

Member Typedef Documentation

◆ relocationsIterator

using retdec::fileformat::RelocationTable::relocationsIterator = std::vector<Relocation>::const_iterator
private

Member Function Documentation

◆ addRelocation()

void retdec::fileformat::RelocationTable::addRelocation ( Relocation relocation)

Add new relocation to table

Parameters
relocationNew relocation

◆ begin()

RelocationTable::relocationsIterator retdec::fileformat::RelocationTable::begin ( ) const

Get begin iterator

Returns
Begin iterator

◆ clear()

void retdec::fileformat::RelocationTable::clear ( )

Delete all records from table

◆ dump()

void retdec::fileformat::RelocationTable::dump ( std::string &  dumpTable) const

Dump information about all relocations in table

Parameters
dumpTableInto this parameter is stored dump of relocation table in an LLVM style

◆ end()

RelocationTable::relocationsIterator retdec::fileformat::RelocationTable::end ( ) const

Get end iterator

Returns
End iterator

◆ getLinkToSymbolTable()

unsigned long long retdec::fileformat::RelocationTable::getLinkToSymbolTable ( ) const

Returns the link to associated symbol table

Returns
Link to symbol table

◆ getNumberOfRelocations()

std::size_t retdec::fileformat::RelocationTable::getNumberOfRelocations ( ) const

Get number of relocations in table

Returns
Number of relocations in table

◆ getRelocation() [1/2]

const Relocation * retdec::fileformat::RelocationTable::getRelocation ( const std::string &  name) const

Get relocation by name

Parameters
nameName of the relocation to get
Returns
Pointer to relocation with the specified name or nullptr if such item not found

◆ getRelocation() [2/2]

const Relocation * retdec::fileformat::RelocationTable::getRelocation ( std::size_t  relocationIndex) const

Get pointer to relocation from table

Parameters
relocationIndexIndex of selected relocation (indexed from 0)
Returns
Pointer to selected relocation or nullptr if relocation index is invalid

◆ getRelocationOnAddress()

const Relocation * retdec::fileformat::RelocationTable::getRelocationOnAddress ( unsigned long long  addr) const

Get pointer to relocation from table

Parameters
addrAddress of selected relocation
Returns
Pointer to relocation or nullptr if relocation address is invalid

◆ hasRelocation() [1/2]

bool retdec::fileformat::RelocationTable::hasRelocation ( const std::string &  name) const

Check if relocation with name name exists

Parameters
nameName of relocation
Returns
true if has relocation with name name, false otherwise

◆ hasRelocation() [2/2]

bool retdec::fileformat::RelocationTable::hasRelocation ( unsigned long long  addr) const

Check if relocation on address exists

Parameters
addrAdress of relocation
Returns
true if has relocation on address, false otherwise

◆ hasRelocations()

bool retdec::fileformat::RelocationTable::hasRelocations ( ) const

Find out if there are any relocations.

Returns
true if there are some relocations, false otherwise.

◆ setLinkToSymbolTable()

void retdec::fileformat::RelocationTable::setLinkToSymbolTable ( std::uint64_t  symbolTableIndex)

Set the link to associated symbol table

Parameters
symbolTableIndexIndex of the symbol table

Member Data Documentation

◆ linkToSymbolTable

unsigned long long retdec::fileformat::RelocationTable::linkToSymbolTable
private

link to associated symbol table

◆ table

std::vector<Relocation> retdec::fileformat::RelocationTable::table
private

stored relocations


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