LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::MachO::RelocationDyld Class Reference

Class that represents a relocation found in the DyldInfo structure. More...

#include <RelocationDyld.hpp>

Inheritance diagram for LIEF::MachO::RelocationDyld:
Collaboration diagram for LIEF::MachO::RelocationDyld:

Public Member Functions

 RelocationDyld ()=default
 
RelocationDyldoperator= (const RelocationDyld &)=default
 
 RelocationDyld (const RelocationDyld &)=default
 
 ~RelocationDyld () override=default
 
std::unique_ptr< Relocationclone () const override
 
bool is_pc_relative () const override
 Indicates whether the item containing the address to be relocated is part of a CPU instruction that uses PC-relative addressing.
 
ORIGIN origin () const override
 Origin of the relocation. For this concrete object, it should be Relocation::ORIGIN::DYLDINFO.
 
void pc_relative (bool val) override
 
bool operator< (const RelocationDyld &rhs) const
 
bool operator>= (const RelocationDyld &rhs) const
 
bool operator> (const RelocationDyld &rhs) const
 
bool operator<= (const RelocationDyld &rhs) const
 
void accept (Visitor &visitor) const override
 
std::ostream & print (std::ostream &os) const override
 
 Relocation ()=default
 
 Relocation (uint64_t address, uint8_t type)
 
 Relocation (const Relocation &other)
 
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
 
- Public Member Functions inherited from LIEF::MachO::Relocation
 Relocation ()=default
 
 Relocation (uint64_t address, uint8_t type)
 
Relocationoperator= (const Relocation &other)
 
 Relocation (const Relocation &other)
 
void swap (Relocation &other) noexcept
 
 ~Relocation () override=default
 
virtual uint8_t type () const
 Type of the relocation according to the Relocation::architecture and/or the Relocation::origin.
 
Header::CPU_TYPE architecture () const
 Achitecture targeted by this relocation.
 
bool has_symbol () const
 true if the relocation has a symbol associated with
 
Symbolsymbol ()
 Symbol associated with the relocation, if any, otherwise a nullptr.
 
const Symbolsymbol () const
 
bool has_section () const
 true if the relocation has a section associated with
 
Sectionsection ()
 Section associated with the relocation, if any, otherwise a nullptr.
 
const Sectionsection () const
 
bool has_segment () const
 true if the relocation has a SegmentCommand associated with
 
SegmentCommandsegment ()
 SegmentCommand associated with the relocation, if any, otherwise a nullptr.
 
const SegmentCommandsegment () const
 
template<class T >
const T * cast () const
 
template<class T >
T * cast ()
 
virtual void type (uint8_t type)
 
virtual uint64_t address () const
 Relocation's address.
 
virtual void address (uint64_t address)
 
virtual size_t size () const
 Relocation size in bits
 
virtual void size (size_t size)
 
- Public Member Functions inherited from LIEF::Relocation
 Relocation ()=default
 
 Relocation (uint64_t address, uint8_t size)
 Constructor from a relocation's address and size.
 
 ~Relocation () override=default
 
Relocationoperator= (const Relocation &)=default
 
 Relocation (const Relocation &)=default
 
void swap (Relocation &other)
 
- Public Member Functions inherited from LIEF::Object
 Object ()
 
 Object (const Object &other)
 
Objectoperator= (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
 
virtual ~Object ()
 

Static Public Member Functions

static bool classof (const Relocation &r)
 

Additional Inherited Members

- Public Types inherited from LIEF::MachO::Relocation
enum class  ORIGIN { UNKNOWN = 0 , DYLDINFO = 1 , RELOC_TABLE = 2 , CHAINED_FIXUPS = 3 }
 
- Public Types inherited from LIEF::Object
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>>>
 
- Static Public Attributes inherited from LIEF::MachO::Relocation
static constexpr auto R_SCATTERED = uint32_t(0x80000000)
 
static constexpr auto R_ABS = uint32_t(0)
 

Detailed Description

Class that represents a relocation found in the DyldInfo structure.

While this class does not have an associated structure in the Mach-O format specification, it provides a convenient interface for the Dyld::rebase

Constructor & Destructor Documentation

◆ RelocationDyld() [1/2]

LIEF::MachO::RelocationDyld::RelocationDyld ( )
default

◆ RelocationDyld() [2/2]

LIEF::MachO::RelocationDyld::RelocationDyld ( const RelocationDyld & )
default

◆ ~RelocationDyld()

LIEF::MachO::RelocationDyld::~RelocationDyld ( )
overridedefault

Member Function Documentation

◆ accept()

void LIEF::MachO::RelocationDyld::accept ( Visitor & visitor) const
overridevirtual

Reimplemented from LIEF::MachO::Relocation.

◆ classof()

static bool LIEF::MachO::RelocationDyld::classof ( const Relocation & r)
inlinestatic

◆ clone()

std::unique_ptr< Relocation > LIEF::MachO::RelocationDyld::clone ( ) const
inlineoverridevirtual

◆ is_pc_relative()

bool LIEF::MachO::RelocationDyld::is_pc_relative ( ) const
overridevirtual

Indicates whether the item containing the address to be relocated is part of a CPU instruction that uses PC-relative addressing.

For addresses contained in PC-relative instructions, the CPU adds the address of the instruction to the address contained in the instruction.

Implements LIEF::MachO::Relocation.

◆ operator<() [1/2]

virtual bool LIEF::Relocation::operator< ( const Relocation & rhs) const
inlinevirtual

Comparaison based on the Relocation's address

Reimplemented from LIEF::Relocation.

◆ operator<() [2/2]

bool LIEF::MachO::RelocationDyld::operator< ( const RelocationDyld & rhs) const

◆ operator<=() [1/2]

virtual bool LIEF::Relocation::operator<= ( const Relocation & rhs) const
inlinevirtual

Comparaison based on the Relocation's address

Reimplemented from LIEF::Relocation.

◆ operator<=() [2/2]

bool LIEF::MachO::RelocationDyld::operator<= ( const RelocationDyld & rhs) const
inline

◆ operator=()

RelocationDyld & LIEF::MachO::RelocationDyld::operator= ( const RelocationDyld & )
default

◆ operator>() [1/2]

virtual bool LIEF::Relocation::operator> ( const Relocation & rhs) const
inlinevirtual

Comparaison based on the Relocation's address

Reimplemented from LIEF::Relocation.

◆ operator>() [2/2]

bool LIEF::MachO::RelocationDyld::operator> ( const RelocationDyld & rhs) const

◆ operator>=() [1/2]

virtual bool LIEF::Relocation::operator>= ( const Relocation & rhs) const
inlinevirtual

Comparaison based on the Relocation's address

Reimplemented from LIEF::Relocation.

◆ operator>=() [2/2]

bool LIEF::MachO::RelocationDyld::operator>= ( const RelocationDyld & rhs) const
inline

◆ origin()

ORIGIN LIEF::MachO::RelocationDyld::origin ( ) const
inlineoverridevirtual

Origin of the relocation. For this concrete object, it should be Relocation::ORIGIN::DYLDINFO.

Implements LIEF::MachO::Relocation.

◆ pc_relative()

void LIEF::MachO::RelocationDyld::pc_relative ( bool val)
overridevirtual

◆ print()

std::ostream & LIEF::MachO::RelocationDyld::print ( std::ostream & os) const
inlineoverridevirtual

Reimplemented from LIEF::MachO::Relocation.

◆ Relocation() [1/3]

LIEF::MachO::Relocation::Relocation ( )
default

◆ Relocation() [2/3]

LIEF::MachO::Relocation::Relocation ( const Relocation & other)

◆ Relocation() [3/3]

LIEF::MachO::Relocation::Relocation ( uint64_t address,
uint8_t type )

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