16#ifndef LIEF_ELF_SYMBOL_H
17#define LIEF_ELF_SYMBOL_H
90 return static_cast<uint8_t
>(
binding);
94 return static_cast<uint8_t
>(
type);
158 uint64_t
size()
const override {
169 return symbol_version_ !=
nullptr;
175 return symbol_version_;
179 return symbol_version_;
Class which represents an ELF binary.
Definition ELF/Binary.hpp:59
Class which parses and transforms an ELF file into a ELF::Binary object.
Definition ELF/Parser.hpp:45
Class which represents an ELF Section.
Definition ELF/Section.hpp:48
Class which represents an entry defined in the DT_VERSYM dynamic entry.
Definition SymbolVersion.hpp:33
void accept(Visitor &visitor) const override
Symbol(const Symbol &other)
const SymbolVersion * symbol_version() const
Definition ELF/Symbol.hpp:178
void shndx(uint16_t idx)
Definition ELF/Symbol.hpp:215
void set_imported(bool flag=true)
Set whether or not the symbol is imported.
uint8_t other() const
Alias for visibility().
Definition ELF/Symbol.hpp:118
~Symbol() override=default
void type(TYPE type)
Definition ELF/Symbol.hpp:197
std::string demangled_name() const
Symbol's unmangled name. If not available, it returns an empty string.
bool is_exported() const
Check if the current symbol is exported.
void binding(BINDING binding)
Definition ELF/Symbol.hpp:201
uint8_t information() const
This member specifies the symbol's type and binding attributes.
TYPE type() const
The symbol's type provides a general classification for the associated entity.
Definition ELF/Symbol.hpp:105
uint64_t size() const override
Symbol size.
Definition ELF/Symbol.hpp:158
void value(uint64_t value) override
Definition ELF/Symbol.hpp:219
BINDING
Definition ELF/Symbol.hpp:40
@ GNU_UNIQUE
Unique symbol.
Definition ELF/Symbol.hpp:44
@ WEAK
Weak symbol.
Definition ELF/Symbol.hpp:43
@ LOCAL
Local symbol.
Definition ELF/Symbol.hpp:41
@ GLOBAL
Global symbol.
Definition ELF/Symbol.hpp:42
bool is_variable() const
True if the symbol represent a variable.
Definition ELF/Symbol.hpp:250
const Section * section() const
Definition ELF/Symbol.hpp:137
BINDING binding() const
The symbol's binding determines the linkage visibility and behavior.
Definition ELF/Symbol.hpp:110
SECTION_INDEX
Special section indices.
Definition ELF/Symbol.hpp:70
@ COMMON
Associated symbol is common.
Definition ELF/Symbol.hpp:73
@ ABS
Associated symbol is absolute.
Definition ELF/Symbol.hpp:72
@ UNDEF
Undefined section.
Definition ELF/Symbol.hpp:71
Symbol(std::string name)
Definition ELF/Symbol.hpp:77
uint16_t shndx() const
Definition ELF/Symbol.hpp:163
bool is_local() const
Definition ELF/Symbol.hpp:182
friend class Binary
Definition ELF/Symbol.hpp:37
bool is_global() const
Definition ELF/Symbol.hpp:186
void size(uint64_t size) override
Definition ELF/Symbol.hpp:223
Symbol & operator=(Symbol other)
friend class Parser
Definition ELF/Symbol.hpp:36
uint16_t section_idx() const
ELF::Section index associated with the symbol.
Definition ELF/Symbol.hpp:123
TYPE
Type of the symbol. This enum matches the STT_xxx values of the ELF specs.
Definition ELF/Symbol.hpp:49
@ NOTYPE
Symbol's type is not specified.
Definition ELF/Symbol.hpp:50
@ TLS
Thread local data object.
Definition ELF/Symbol.hpp:56
@ FUNC
Symbol is executable code (function, etc.).
Definition ELF/Symbol.hpp:52
@ GNU_IFUNC
GNU indirect function.
Definition ELF/Symbol.hpp:57
@ SECTION
Symbol refers to a section.
Definition ELF/Symbol.hpp:53
@ OBJECT
Symbol is a data object (variable, array, etc.).
Definition ELF/Symbol.hpp:51
@ FILE
Local, absolute symbol that refers to a file.
Definition ELF/Symbol.hpp:54
void visibility(VISIBILITY visibility)
Definition ELF/Symbol.hpp:209
void set_exported(bool flag=true)
Set whether or not the symbol is exported.
bool is_imported() const
Check if the current symbol is imported.
static BINDING binding_from(uint32_t value, ARCH)
Definition ELF/Symbol.hpp:81
Section * section()
Section associated with the symbol or a nullptr if it does not exist.
Definition ELF/Symbol.hpp:133
bool is_weak() const
Definition ELF/Symbol.hpp:190
bool has_version() const
Check if this symbols has a symbol version .
Definition ELF/Symbol.hpp:168
static TYPE type_from(uint32_t value, ARCH)
Definition ELF/Symbol.hpp:85
void other(uint8_t other)
Definition ELF/Symbol.hpp:205
void information(uint8_t info)
VISIBILITY visibility() const
Symbol visibility.
Definition ELF/Symbol.hpp:128
SymbolVersion * symbol_version()
Return the SymbolVersion associated with this symbol. If there is no symbol version,...
Definition ELF/Symbol.hpp:174
static uint8_t to_value(TYPE type)
Definition ELF/Symbol.hpp:93
uint64_t value() const override
This member has slightly different interpretations:
Definition ELF/Symbol.hpp:149
bool is_static() const
True if the symbol is a static one.
Definition ELF/Symbol.hpp:240
bool is_function() const
True if the symbol represent a function.
Definition ELF/Symbol.hpp:245
static uint8_t to_value(BINDING binding)
Definition ELF/Symbol.hpp:89
VISIBILITY
Visibility of the symbol. This enum matches the STV_xxx values of the official ELF specs.
Definition ELF/Symbol.hpp:62
@ PROTECTED
Visible in other components but not preemptable.
Definition ELF/Symbol.hpp:66
@ INTERNAL
Defined by processor supplements.
Definition ELF/Symbol.hpp:64
@ HIDDEN
Not visible to other components.
Definition ELF/Symbol.hpp:65
@ DEFAULT
Visibility is specified by binding type.
Definition ELF/Symbol.hpp:63
friend std::ostream & operator<<(std::ostream &os, const Symbol &entry)
This class represents a symbol in an executable format.
Definition Abstract/Symbol.hpp:28
virtual const std::string & name() const
Return the symbol's name.
Definition Abstract/Symbol.hpp:54
Definition Visitor.hpp:210
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
const char * to_string(DynamicEntry::TAG e)
ARCH
Definition ELF/enums.hpp:30
@ NONE
Definition ELF/enums.hpp:31
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:41