LIEF: Library to Instrument Executable Formats Version
|
Class that represents an ELF relocation. More...
#include <Relocation.hpp>
Public Member Functions | |
Relocation (const details::Elf32_Rel &header) | |
Relocation (const details::Elf32_Rela &header) | |
Relocation (const details::Elf64_Rel &header) | |
Relocation (const details::Elf64_Rela &header) | |
Relocation (uint64_t address, uint32_t type=0, int64_t addend=0, bool isRela=false) | |
template<class T , typename = typename std::enable_if<std::is_enum<T>::value>::type> | |
Relocation (uint64_t address, T type, int64_t addend=0, bool isRela=false) | |
Relocation (ARCH arch) | |
Relocation & | operator= (Relocation other) |
Relocation (const Relocation &other) | |
void | swap (Relocation &other) |
int64_t | addend () const |
Additional value that can be involved in the relocation processing. | |
uint32_t | type () const |
Type of the relocation This type depends on the underlying architecture which can be accessed with architecture(). | |
bool | is_rela () const |
Check if the relocation uses the explicit addend() field (this is usually the case for 64 bits binaries) | |
bool | is_rel () const |
Check if the relocation uses the implicit added (i.e. not present in the ELF structure) | |
uint32_t | info () const |
Relocation info which contains for instance the symbol index. | |
ARCH | architecture () const |
RELOCATION_PURPOSES | purpose () const |
size_t | size () const override |
Return the size (in bits) of the value associated with this relocation. | |
bool | has_symbol () const |
True if the current relocation is associated with a symbol. | |
Symbol * | symbol () |
Symbol associated with the relocation If no symbol is tied to this relocation, it returns a nullptr. | |
const Symbol * | symbol () const |
bool | has_section () const |
True if the relocation has an associated section. | |
Section * | section () |
The section to which the relocation applies. If no section to which the relocation applies is associtated to this relocation, it returns a nullptr. | |
const Section * | section () const |
Section * | symbol_table () |
The associated symbol table. If no symbol table section is associated with this relocation, it returns a nullptr. | |
const Section * | symbol_table () const |
void | addend (int64_t addend) |
void | type (uint32_t type) |
void | purpose (RELOCATION_PURPOSES purpose) |
void | info (uint32_t v) |
void | symbol (Symbol *symbol) |
void | section (Section *section) |
void | symbol_table (Section *section) |
void | accept (Visitor &visitor) const override |
![]() | |
Relocation (uint64_t address, uint8_t size) | |
Constructor from a relocation's address and size. | |
Relocation & | operator= (const Relocation &) |
Relocation (const Relocation &) | |
void | swap (Relocation &other) |
virtual uint64_t | address () const |
Relocation's address. | |
virtual void | address (uint64_t address) |
virtual void | size (size_t size) |
void | accept (Visitor &visitor) const override |
Method so that the visitor can visit us. | |
virtual bool | operator< (const Relocation &rhs) const |
Comparaison based on the Relocation's address | |
virtual bool | operator<= (const Relocation &rhs) const |
Comparaison based on the Relocation's address | |
virtual bool | operator> (const Relocation &rhs) const |
Comparaison based on the Relocation's address | |
virtual bool | operator>= (const Relocation &rhs) const |
Comparaison based on the Relocation's address | |
![]() | |
Object (const Object &other) | |
Object & | operator= (const Object &other) |
template<class T > | |
output_t< T > | as () |
template<class T > | |
output_const_t< T > | as () const |
virtual bool | operator== (const Object &other) const |
virtual bool | operator!= (const Object &other) const |
Additional Inherited Members | |
![]() | |
template<class T > | |
using | output_t = add_pointer_t< decay_t< T > > |
template<class T > | |
using | output_const_t = add_pointer_t< add_const_t< decay_t< T > > > |
Class that represents an ELF relocation.
|
overridevirtual |
Implements LIEF::Object.
|
overridevirtual |
Return the size (in bits) of the value associated with this relocation.
Return -1 if it fails
Reimplemented from LIEF::Relocation.
uint32_t LIEF::ELF::Relocation::type | ( | ) | const |
Type of the relocation This type depends on the underlying architecture which can be accessed with architecture().
Depending on the architecture, it can return: