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

This class represents a symbol binding operation associated with the LC_DYLD_INFO bytecode. More...

#include <DyldBindingInfo.hpp>

Inheritance diagram for LIEF::MachO::DyldBindingInfo:
Collaboration diagram for LIEF::MachO::DyldBindingInfo:

Public Types

enum class  CLASS : uint64_t { WEAK = 1u , LAZY = 2u , STANDARD = 3u , THREADED = 100u }
 
enum class  TYPE : uint64_t { POINTER = 1u , TEXT_ABSOLUTE32 = 2u , TEXT_PCREL32 = 3u }
 
- Public Types inherited from LIEF::MachO::BindingInfo
enum class  TYPES { UNKNOWN = 0 , DYLD_INFO , CHAINED , CHAINED_LIST }
 
- 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>>>
 

Public Member Functions

 DyldBindingInfo ()=default
 
 DyldBindingInfo (CLASS cls, TYPE type, uint64_t address, int64_t addend=0, int32_t oridnal=0, bool is_weak=false, bool is_non_weak_definition=false, uint64_t offset=0)
 
DyldBindingInfooperator= (const DyldBindingInfo &other)=default
 
 DyldBindingInfo (const DyldBindingInfo &other)=default
 
 DyldBindingInfo (DyldBindingInfo &&) noexcept=default
 
void swap (DyldBindingInfo &other) noexcept
 
CLASS binding_class () const
 Class of the binding (weak, lazy, ...)
 
void binding_class (CLASS bind_class)
 
TYPE binding_type () const
 Type of the binding. Most of the times it's TYPE::POINTER.
 
void binding_type (TYPE type)
 
bool is_non_weak_definition () const
 
void set_non_weak_definition (bool val)
 
uint64_t original_offset () const
 Original relative offset of the binding opcodes.
 
BindingInfo::TYPES type () const override
 The type of the binding. This type provides the origin of the binding (LC_DYLD_INFO or LC_DYLD_CHAINED_FIXUPS)
 
 ~DyldBindingInfo () override=default
 
void accept (Visitor &visitor) const override
 
- Public Member Functions inherited from LIEF::MachO::BindingInfo
 BindingInfo ()=default
 
 BindingInfo (const BindingInfo &other)
 
void swap (BindingInfo &other) noexcept
 
bool has_segment () const
 Check if a MachO::SegmentCommand is associated with this binding.
 
const SegmentCommandsegment () const
 The MachO::SegmentCommand associated with the BindingInfo or a nullptr of it is not bind to a SegmentCommand.
 
SegmentCommandsegment ()
 
bool has_library () const
 Check if a MachO::DylibCommand is tied with the BindingInfo.
 
const DylibCommandlibrary () const
 MachO::DylibCommand associated with the BindingInfo or a nullptr if not present.
 
DylibCommandlibrary ()
 
bool has_symbol () const
 Check if a MachO::Symbol is associated with the BindingInfo.
 
const Symbolsymbol () const
 MachO::Symbol associated with the BindingInfo or a nullptr if not present.
 
Symbolsymbol ()
 
virtual uint64_t address () const
 Address of the binding.
 
virtual void address (uint64_t addr)
 
int32_t library_ordinal () const
 
void library_ordinal (int32_t ordinal)
 
int64_t addend () const
 Value added to the segment's virtual address when bound.
 
void addend (int64_t addend)
 
bool is_weak_import () const
 
void set_weak_import (bool val=true)
 
 ~BindingInfo () override=default
 
- 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 BindingInfo *info)
 

Detailed Description

This class represents a symbol binding operation associated with the LC_DYLD_INFO bytecode.

It does not represent a structure that exists in the Mach-O format specifications but it provides a view on an entry of the Dyld binding opcodes.

See also
: BindingInfo

Member Enumeration Documentation

◆ CLASS

enum class LIEF::MachO::DyldBindingInfo::CLASS : uint64_t
strong
Enumerator
WEAK 
LAZY 
STANDARD 
THREADED 

◆ TYPE

enum class LIEF::MachO::DyldBindingInfo::TYPE : uint64_t
strong
Enumerator
POINTER 
TEXT_ABSOLUTE32 
TEXT_PCREL32 

Constructor & Destructor Documentation

◆ DyldBindingInfo() [1/4]

LIEF::MachO::DyldBindingInfo::DyldBindingInfo ( )
default

◆ DyldBindingInfo() [2/4]

LIEF::MachO::DyldBindingInfo::DyldBindingInfo ( CLASS cls,
TYPE type,
uint64_t address,
int64_t addend = 0,
int32_t oridnal = 0,
bool is_weak = false,
bool is_non_weak_definition = false,
uint64_t offset = 0 )

◆ DyldBindingInfo() [3/4]

LIEF::MachO::DyldBindingInfo::DyldBindingInfo ( const DyldBindingInfo & other)
default

◆ DyldBindingInfo() [4/4]

LIEF::MachO::DyldBindingInfo::DyldBindingInfo ( DyldBindingInfo && )
defaultnoexcept

◆ ~DyldBindingInfo()

LIEF::MachO::DyldBindingInfo::~DyldBindingInfo ( )
overridedefault

Member Function Documentation

◆ accept()

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

Reimplemented from LIEF::MachO::BindingInfo.

◆ binding_class() [1/2]

CLASS LIEF::MachO::DyldBindingInfo::binding_class ( ) const
inline

Class of the binding (weak, lazy, ...)

◆ binding_class() [2/2]

void LIEF::MachO::DyldBindingInfo::binding_class ( CLASS bind_class)
inline

◆ binding_type() [1/2]

TYPE LIEF::MachO::DyldBindingInfo::binding_type ( ) const
inline

Type of the binding. Most of the times it's TYPE::POINTER.

◆ binding_type() [2/2]

void LIEF::MachO::DyldBindingInfo::binding_type ( TYPE type)
inline

◆ classof()

static bool LIEF::MachO::DyldBindingInfo::classof ( const BindingInfo * info)
inlinestatic

◆ is_non_weak_definition()

bool LIEF::MachO::DyldBindingInfo::is_non_weak_definition ( ) const
inline

◆ operator=()

DyldBindingInfo & LIEF::MachO::DyldBindingInfo::operator= ( const DyldBindingInfo & other)
default

◆ original_offset()

uint64_t LIEF::MachO::DyldBindingInfo::original_offset ( ) const
inline

Original relative offset of the binding opcodes.

◆ set_non_weak_definition()

void LIEF::MachO::DyldBindingInfo::set_non_weak_definition ( bool val)
inline

◆ swap()

void LIEF::MachO::DyldBindingInfo::swap ( DyldBindingInfo & other)
noexcept

◆ type()

BindingInfo::TYPES LIEF::MachO::DyldBindingInfo::type ( ) const
inlineoverridevirtual

The type of the binding. This type provides the origin of the binding (LC_DYLD_INFO or LC_DYLD_CHAINED_FIXUPS)

Implements LIEF::MachO::BindingInfo.


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