16#ifndef LIEF_COFF_SYMBOL_H
17#define LIEF_COFF_SYMBOL_H
98 UNDEFINED_STATIC = 14,
221 return auxiliary_symbols_;
225 return auxiliary_symbols_;
253 storage_class_ =
value;
279 String* coff_name_ =
nullptr;
281 uint8_t storage_class_ = 0;
282 int16_t section_idx_ = 0;
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:35
Class that represents an auxiliary symbol.
Definition AuxiliarySymbol.hpp:37
Definition COFF/Parser.hpp:34
This class represents a COFF section.
Definition COFF/Section.hpp:41
This class represents a string located in the COFF string table.
Definition String.hpp:35
Symbol(Symbol &&) noexcept
uint16_t type() const
The symbol type. The first byte represents the base type (see: base_type()) while the upper byte repr...
Definition COFF/Symbol.hpp:146
bool is_absolute() const
Definition COFF/Symbol.hpp:199
ref_iterator< auxiliary_symbols_t &, AuxiliarySymbol * > it_auxiliary_symbols_t
Definition COFF/Symbol.hpp:43
COMPLEX_TYPE
Definition COFF/Symbol.hpp:131
@ TY_FUNCTION
A function that returns a base type.
Definition COFF/Symbol.hpp:134
Symbol & storage_class(uint8_t value)
Definition COFF/Symbol.hpp:252
const Section * section() const
Definition COFF/Symbol.hpp:187
COMPLEX_TYPE complex_type() const
The complex type (if any).
Definition COFF/Symbol.hpp:162
bool is_function_line_info() const
Definition COFF/Symbol.hpp:207
Symbol & section_idx(int16_t idx)
Definition COFF/Symbol.hpp:257
bool is_file_record() const
Definition COFF/Symbol.hpp:215
Section * section()
Section associated with this symbol (if any).
Definition COFF/Symbol.hpp:183
const_ref_iterator< const auxiliary_symbols_t &, AuxiliarySymbol * > it_const_auxiliary_symbols_t
Definition COFF/Symbol.hpp:46
bool is_function() const
Definition COFF/Symbol.hpp:211
BASE_TYPE base_type() const
The simple (base) data type.
Definition COFF/Symbol.hpp:157
std::vector< std::unique_ptr< AuxiliarySymbol > > auxiliary_symbols_t
Definition COFF/Symbol.hpp:41
bool is_external() const
Definition COFF/Symbol.hpp:191
BASE_TYPE
Definition COFF/Symbol.hpp:112
std::string_view name() const override
Name of the symbol. If the symbol does not use a short name, it returns the string pointed by the COF...
STORAGE_CLASS
Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#storage-class.
Definition COFF/Symbol.hpp:80
@ EXTERNAL
External symbol.
Definition COFF/Symbol.hpp:86
@ FUNCTION
Definition COFF/Symbol.hpp:104
@ WEAK_EXTERNAL
Duplicate tag.
Definition COFF/Symbol.hpp:108
@ FILE
File name.
Definition COFF/Symbol.hpp:106
Symbol & type(uint16_t ty)
Definition COFF/Symbol.hpp:247
static constexpr auto SYM_SEC_IDX_ABS
The symbol has an absolute (non-relocatable) value and is not an address.
Definition COFF/Symbol.hpp:69
static constexpr auto SYM_SEC_IDX_DEBUG
The symbol provides general type or debugging information but does not correspond to a section....
Definition COFF/Symbol.hpp:66
const String * coff_name() const
COFF string used to represent the (long) symbol name.
Definition COFF/Symbol.hpp:235
it_auxiliary_symbols_t auxiliary_symbols()
Auxiliary symbols associated with this symbol.
Definition COFF/Symbol.hpp:220
static constexpr auto SYM_SEC_IDX_UNDEF
The symbol record is not yet assigned a section. A value of zero indicates that a reference to an ext...
Definition COFF/Symbol.hpp:74
std::string to_string() const
String * coff_name()
Definition COFF/Symbol.hpp:239
static std::unique_ptr< Symbol > parse(parsing_context_t &ctx, BinaryStream &stream, size_t *idx)
int16_t section_idx() const
The signed integer that identifies the section, using a one-based index into the section table....
Definition COFF/Symbol.hpp:178
friend class Parser
Definition COFF/Symbol.hpp:39
static constexpr bool is_reversed_sec_idx(int16_t idx)
Check if the given section index is a reserved value.
Definition COFF/Symbol.hpp:139
bool is_undefined() const
Definition COFF/Symbol.hpp:203
AuxiliarySymbol & add_aux(std::unique_ptr< AuxiliarySymbol > sym)
Add a new auxiliary record.
bool is_weak_external() const
Definition COFF/Symbol.hpp:195
it_const_auxiliary_symbols_t auxiliary_symbols() const
Definition COFF/Symbol.hpp:224
Symbol & operator=(const Symbol &)
std::string demangled_name() const
Demangled representation of the symbol or an empty string if it can't be demangled.
static constexpr auto SYM_COMPLEX_TYPE_SHIFT
Definition COFF/Symbol.hpp:76
STORAGE_CLASS storage_class() const
Storage class of the symbol which indicates what kind of definition a symbol represents.
Definition COFF/Symbol.hpp:152
friend std::ostream & operator<<(std::ostream &os, const Symbol &entry)
Definition COFF/Symbol.hpp:268
This class represents a symbol in an executable format.
Definition Abstract/Symbol.hpp:30
virtual uint64_t value() const
Symbol's value which is usually the address of the symbol.
Definition Abstract/Symbol.hpp:70
Iterator which returns reference on container's values.
Definition iterators.hpp:47
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition AuxiliarySymbol.hpp:30
const char * to_string(AuxiliarySectionDefinition::COMDAT_SELECTION e)
LIEF namespace.
Definition Abstract/Binary.hpp:41
ref_iterator< CT, U, typename decay_t< CT >::const_iterator > const_ref_iterator
Iterator which returns a const ref on container's values.
Definition iterators.hpp:316
Definition COFF/Symbol.hpp:49
bool is_bigobj
Definition COFF/Symbol.hpp:51
std::function< String *(uint32_t)> find_string
Definition COFF/Symbol.hpp:50
#define LIEF_API
Definition visibility.h:45