LIEF: Library to Instrument Executable Formats Version 0.17.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_ELF_SYMBOL_VERSION_H
17#define LIEF_ELF_SYMBOL_VERSION_H
37 static constexpr auto LOCAL_VERSION = 0;
38 static constexpr auto GLOBAL_VERSION = 1;
44 static SymbolVersion
local() {
47 return SymbolVersion(LOCAL_VERSION);
49 static SymbolVersion
global() {
52 return SymbolVersion(GLOBAL_VERSION);
57 SymbolVersion&
operator=(
const SymbolVersion&) =
default;
59 uint16_t
value()
const {
72 return symbol_version_auxiliary() !=
nullptr;
95 if (symbol_aux_ ==
nullptr) {
98 assert(value == LOCAL_VERSION || value == GLOBAL_VERSION);
100 symbol_aux_ =
nullptr;
107 return drop_version(GLOBAL_VERSION);
114 return drop_version(LOCAL_VERSION);
121 void accept(Visitor& visitor)
const override;
127 SymbolVersionAux* symbol_aux_ =
nullptr;
Class which parses and transforms an ELF file into a ELF::Binary object.
Definition ELF/Parser.hpp:45
Definition SymbolVersionAuxRequirement.hpp:35
Class which represents an Auxiliary Symbol version.
Definition SymbolVersionAux.hpp:30
Class which represents an entry defined in the DT_VERSYM dynamic entry.
Definition SymbolVersion.hpp:33
const SymbolVersionAux * symbol_version_auxiliary() const
Definition SymbolVersion.hpp:81
bool has_auxiliary_version() const
Whether the current SymbolVersion has an auxiliary one.
Definition SymbolVersion.hpp:71
SymbolVersion & operator=(const SymbolVersion &)=default
void drop_version(uint16_t value)
Drop the versioning requirement and replace the value (local/global)
Definition SymbolVersion.hpp:94
static SymbolVersion local()
Generate a local SymbolVersion.
Definition SymbolVersion.hpp:46
~SymbolVersion() override=default
friend std::ostream & operator<<(std::ostream &os, const SymbolVersion &symv)
void accept(Visitor &visitor) const override
SymbolVersion(const SymbolVersion &)=default
void symbol_version_auxiliary(SymbolVersionAuxRequirement &svauxr)
Set the version's auxiliary requirement The given SymbolVersionAuxRequirement must be an existing ref...
static SymbolVersion global()
Generate a global SymbolVersion.
Definition SymbolVersion.hpp:51
void as_local()
Redefine this version as local by dropping its auxiliary version.
Definition SymbolVersion.hpp:113
void as_global()
Redefine this version as global by dropping its auxiliary version.
Definition SymbolVersion.hpp:106
SymbolVersion(uint16_t value)
Definition SymbolVersion.hpp:40
void value(uint16_t v)
Definition SymbolVersion.hpp:117
SymbolVersionAux * symbol_version_auxiliary()
SymbolVersionAux associated with the current Version if any, or a nullptr.
Definition SymbolVersion.hpp:77
uint16_t value() const
Value associated with the symbol.
Definition SymbolVersion.hpp:66
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:39
#define LIEF_API
Definition visibility.h:41