LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LIEF::MachO::Relocation Class Referenceabstract

Class that represents a Mach-O relocation. More...

#include <Relocation.hpp>

Inheritance diagram for LIEF::MachO::Relocation:
Inheritance graph
[legend]
Collaboration diagram for LIEF::MachO::Relocation:
Collaboration graph
[legend]

Public Member Functions

 Relocation (uint64_t address, uint8_t type)
 
Relocationoperator= (const Relocation &other)
 
 Relocation (const Relocation &other)
 
void swap (Relocation &other)
 
virtual Relocationclone () const =0
 
virtual bool is_pc_relative () const =0
 Indicates whether the item containing the address to be relocated is part of a CPU instruction that uses PC-relative addressing.
 
virtual uint8_t type () const
 Type of the relocation according to the Relocation::architecture and/or the Relocation::origin.
 
CPU_TYPES architecture () const
 Achitecture targeted by this relocation.
 
virtual RELOCATION_ORIGINS origin () const =0
 Origin of the 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
 
virtual void pc_relative (bool val)=0
 
virtual void type (uint8_t type)
 
void accept (Visitor &visitor) const override
 
virtual std::ostream & print (std::ostream &os) const
 
- Public Member Functions inherited from LIEF::Relocation
 Relocation (uint64_t address, uint8_t size)
 Constructor from a relocation's address and size.
 
Relocationoperator= (const Relocation &)
 
 Relocation (const Relocation &)
 
void swap (Relocation &other)
 
virtual uint64_t address () const
 Relocation's address.
 
virtual size_t size () const
 Relocation size in bits
 
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
 
- Public Member Functions inherited from LIEF::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
 

Additional Inherited Members

- 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>>>
 

Detailed Description

Class that represents a Mach-O relocation.

See also
:

Member Function Documentation

◆ accept()

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

Implements LIEF::Object.

◆ is_pc_relative()

virtual bool LIEF::MachO::Relocation::is_pc_relative ( ) const
pure virtual

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.

Implemented in LIEF::MachO::RelocationDyld, LIEF::MachO::RelocationFixup, and LIEF::MachO::RelocationObject.

◆ origin()

virtual RELOCATION_ORIGINS LIEF::MachO::Relocation::origin ( ) const
pure virtual

◆ pc_relative()

virtual void LIEF::MachO::Relocation::pc_relative ( bool val)
pure virtual

◆ type()

virtual uint8_t LIEF::MachO::Relocation::type ( ) const
virtual

Type of the relocation according to the Relocation::architecture and/or the Relocation::origin.

See:


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