class SymbolName
Defined at line 40 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
SymbolName represents an identifier to be looked up in a symbol table. It's
really just a string_view with a cache of the string's hash value(s). The
type is constexpr friendly and when used in a constexpr context with a
string literal, it can precompute at compile time to optimize.
The Lookup calls are just front-ends that take a SymbolInfo object and call
its Lookup method (see below).
Note that though this is a cheaply-copyable type, it's always best to pass
it by mutable reference so its cache can be updated as needed (outside
constexpr context). Lookup has both const and non-const overloads, but the
const overload has to recompute every time if the hash isn't already cached.
ELF symbol names cannot contain NUL characters, so it's an invariant that
SymbolName cannot contain embedded NULs (unlike std::string_view, which can).
Construction and assignment enforce this by turning a std::string_view argument
that contains embedded NULs into the empty string.
Public Methods
void SymbolName ()
Defined at line 44 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
void SymbolName (const SymbolName & )
Defined at line 46 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
template <size_t N>
void SymbolName (const char (&)[N] name)
When constructing from a constant, precompute the hashes since it can be
done entirely in constexpr context.
Defined at line 51 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
template <size_t N>
void SymbolName (const char (&)[N] name)
When constructing from a constant, precompute the hashes since it can be
done entirely in constexpr context.
Defined at line 51 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
template <size_t N>
void SymbolName (const char (&)[N] name)
When constructing from a constant, precompute the hashes since it can be
done entirely in constexpr context.
Defined at line 51 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
void SymbolName (std::string_view name)
This will precompute the hashes in constexpr context, see below.
Defined at line 57 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
void SymbolName (std::string_view name)
This will precompute the hashes in constexpr context, see below.
Defined at line 57 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
void SymbolName (const char * name)
Defined at line 59 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
template <class SymbolInfo, class Sym>
void SymbolName (const SymbolInfo & si, const Sym & sym)
Convenient constructor using a symbol table entry (see below).
Defined at line 63 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
SymbolName & operator= (const SymbolName & )
Defined at line 65 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
SymbolName & operator= (std::string_view name)
Defined at line 67 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
SymbolName & operator= (std::string_view name)
Defined at line 67 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
SymbolName & operator= (const char * name)
Defined at line 76 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
uint32_t compat_hash ()
Defined at line 82 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
uint32_t compat_hash ()
Defined at line 89 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
uint32_t gnu_hash ()
Defined at line 91 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
uint32_t gnu_hash ()
Defined at line 98 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
template <class SymbolInfoType, typename Filter>
const SymbolInfoType::Sym * Lookup (const SymbolInfoType & si, Filter && filter)
Defined at line 101 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
template <class SymbolInfoType, typename Filter>
const SymbolInfoType::Sym * Lookup (const SymbolInfoType & si, Filter && filter)
A const object can't update its cache, but constexpr will already have it.
Defined at line 118 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
template <class SymbolInfoType>
auto Lookup (const SymbolInfoType & si)
Defined at line 124 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h
template <class SymbolInfoType>
auto Lookup (const SymbolInfoType & si)
Defined at line 129 of file ../../src/lib/elfldltl/include/lib/elfldltl/symbol.h