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

Class which represents an entry defined in the DT_VERSYM dynamic entry. More...

#include <SymbolVersion.hpp>

Inheritance diagram for LIEF::ELF::SymbolVersion:
Collaboration diagram for LIEF::ELF::SymbolVersion:

Public Member Functions

 SymbolVersion (uint16_t value)
 SymbolVersion ()=default
 ~SymbolVersion () override=default
SymbolVersionoperator= (const SymbolVersion &)=default
 SymbolVersion (const SymbolVersion &)=default
uint16_t value () const
 Value associated with the symbol.
bool has_auxiliary_version () const
 Whether the current SymbolVersion has an auxiliary one.
SymbolVersionAuxsymbol_version_auxiliary ()
 SymbolVersionAux associated with the current Version if any, or a nullptr.
const SymbolVersionAuxsymbol_version_auxiliary () const
void symbol_version_auxiliary (SymbolVersionAuxRequirement &svauxr)
 Set the version's auxiliary requirement The given SymbolVersionAuxRequirement must be an existing reference in the ELF::Binary.
void drop_version (uint16_t value)
 Drop the versioning requirement and replace the value (local/global).
void as_global ()
 Redefine this version as global by dropping its auxiliary version.
void as_local ()
 Redefine this version as local by dropping its auxiliary version.
void value (uint16_t v)
void accept (Visitor &visitor) const override
Public Member Functions inherited from LIEF::Object
 Object ()
 Object (const Object &other)
Objectoperator= (const Object &other)
 Object (Object &&other) noexcept=default
Objectoperator= (Object &&other) noexcept=default
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 SymbolVersion local ()
 Generate a local SymbolVersion.
static SymbolVersion global ()
 Generate a global SymbolVersion.

Static Public Attributes

static constexpr auto LOCAL_VERSION = 0
static constexpr auto GLOBAL_VERSION = 1

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 which represents an entry defined in the DT_VERSYM dynamic entry.

Constructor & Destructor Documentation

◆ SymbolVersion() [1/3]

LIEF::ELF::SymbolVersion::SymbolVersion ( uint16_t value)
inline

References value().

Referenced by global(), local(), operator<<, operator=(), and SymbolVersion().

◆ SymbolVersion() [2/3]

LIEF::ELF::SymbolVersion::SymbolVersion ( )
default

◆ ~SymbolVersion()

LIEF::ELF::SymbolVersion::~SymbolVersion ( )
overridedefault

◆ SymbolVersion() [3/3]

LIEF::ELF::SymbolVersion::SymbolVersion ( const SymbolVersion & )
default

References SymbolVersion().

Member Function Documentation

◆ accept()

void LIEF::ELF::SymbolVersion::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ as_global()

void LIEF::ELF::SymbolVersion::as_global ( )
inline

Redefine this version as global by dropping its auxiliary version.

See also
as_local() drop_version()

References drop_version(), and GLOBAL_VERSION.

◆ as_local()

void LIEF::ELF::SymbolVersion::as_local ( )
inline

Redefine this version as local by dropping its auxiliary version.

See also
as_global() drop_version()

References drop_version(), and LOCAL_VERSION.

◆ drop_version()

void LIEF::ELF::SymbolVersion::drop_version ( uint16_t value)
inline

Drop the versioning requirement and replace the value (local/global).

References GLOBAL_VERSION, LOCAL_VERSION, and value().

Referenced by as_global(), and as_local().

◆ global()

SymbolVersion LIEF::ELF::SymbolVersion::global ( )
inlinestatic

Generate a global SymbolVersion.

References GLOBAL_VERSION, and SymbolVersion().

◆ has_auxiliary_version()

bool LIEF::ELF::SymbolVersion::has_auxiliary_version ( ) const
inline

Whether the current SymbolVersion has an auxiliary one.

References symbol_version_auxiliary().

◆ local()

SymbolVersion LIEF::ELF::SymbolVersion::local ( )
inlinestatic

Generate a local SymbolVersion.

References LOCAL_VERSION, and SymbolVersion().

◆ operator=()

SymbolVersion & LIEF::ELF::SymbolVersion::operator= ( const SymbolVersion & )
default

References SymbolVersion().

◆ symbol_version_auxiliary() [1/3]

SymbolVersionAux * LIEF::ELF::SymbolVersion::symbol_version_auxiliary ( )
inline

SymbolVersionAux associated with the current Version if any, or a nullptr.

Referenced by has_auxiliary_version().

◆ symbol_version_auxiliary() [2/3]

const SymbolVersionAux * LIEF::ELF::SymbolVersion::symbol_version_auxiliary ( ) const
inline

◆ symbol_version_auxiliary() [3/3]

void LIEF::ELF::SymbolVersion::symbol_version_auxiliary ( SymbolVersionAuxRequirement & svauxr)

Set the version's auxiliary requirement The given SymbolVersionAuxRequirement must be an existing reference in the ELF::Binary.

On can add a new SymbolVersionAuxRequirement by using SymbolVersionRequirement::add_aux_requirement

◆ value() [1/2]

uint16_t LIEF::ELF::SymbolVersion::value ( ) const
inline

Value associated with the symbol.

If the given SymbolVersion hasn't Auxiliary version:

  • 0 means Local
  • 1 means Global

Referenced by drop_version(), and SymbolVersion().

◆ value() [2/2]

void LIEF::ELF::SymbolVersion::value ( uint16_t v)
inline

Member Data Documentation

◆ GLOBAL_VERSION

auto LIEF::ELF::SymbolVersion::GLOBAL_VERSION = 1
staticconstexpr

Referenced by as_global(), drop_version(), and global().

◆ LOCAL_VERSION

auto LIEF::ELF::SymbolVersion::LOCAL_VERSION = 0
staticconstexpr

Referenced by as_local(), drop_version(), and local().


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