LIEF: Library to Instrument Executable Formats Version 0.17.0
|
"Weak externals" are a mechanism for object files that allows flexibility at link time. A module can contain an unresolved external symbol (sym1
), but it can also include an auxiliary record that indicates that if sym1
is not present at link time, another external symbol (sym2
) is used to resolve references instead.
More...
#include <AuxiliaryWeakExternal.hpp>
Public Types | |
enum class | CHARACTERISTICS : uint32_t { SEARCH_NOLIBRARY = 1 , SEARCH_LIBRARY = 2 , SEARCH_ALIAS = 3 , ANTI_DEPENDENCY = 4 } |
![]() | |
enum class | TYPE { UNKNOWN = 0 , CLR_TOKEN , FUNC_DEF , BF_AND_EF , WEAK_EXTERNAL , FILE , SEC_DEF } |
Type discriminator for the subclasses. More... | |
Public Member Functions | |
AuxiliaryWeakExternal () | |
AuxiliaryWeakExternal (uint32_t sym_idx, uint32_t characteristics, std::vector< uint8_t > padding) | |
AuxiliaryWeakExternal (const AuxiliaryWeakExternal &)=default | |
AuxiliaryWeakExternal & | operator= (const AuxiliaryWeakExternal &)=default |
AuxiliaryWeakExternal (AuxiliaryWeakExternal &&)=default | |
AuxiliaryWeakExternal & | operator= (AuxiliaryWeakExternal &&)=default |
std::unique_ptr< AuxiliarySymbol > | clone () const override |
uint32_t | sym_idx () const |
The symbol-table index of sym2 , the symbol to be linked if sym1 is not found. | |
CHARACTERISTICS | characteristics () const |
span< const uint8_t > | padding () const |
std::string | to_string () const override |
~AuxiliaryWeakExternal () override=default | |
![]() | |
AuxiliarySymbol ()=default | |
AuxiliarySymbol (std::vector< uint8_t > payload) | |
AuxiliarySymbol (const AuxiliarySymbol &)=default | |
AuxiliarySymbol & | operator= (const AuxiliarySymbol &)=default |
AuxiliarySymbol (AuxiliarySymbol &&)=default | |
AuxiliarySymbol & | operator= (AuxiliarySymbol &&)=default |
AuxiliarySymbol (TYPE ty) | |
TYPE | type () const |
span< const uint8_t > | payload () const |
For unknown type only, return the raw representation of this symbol. | |
span< uint8_t > | payload () |
virtual | ~AuxiliarySymbol ()=default |
template<class T > | |
const T * | as () const |
Helper to downcast a AuxiliarySymbol into a concrete implementation. | |
Static Public Member Functions | |
static std::unique_ptr< AuxiliaryWeakExternal > | parse (const std::vector< uint8_t > &payload) |
static bool | classof (const AuxiliarySymbol *sym) |
![]() | |
static std::unique_ptr< AuxiliarySymbol > | parse (Symbol &sym, std::vector< uint8_t > payload) |
static TYPE | get_aux_type (const Symbol &sym) |
"Weak externals" are a mechanism for object files that allows flexibility at link time. A module can contain an unresolved external symbol (sym1
), but it can also include an auxiliary record that indicates that if sym1
is not present at link time, another external symbol (sym2
) is used to resolve references instead.
If a definition of sym1
is linked, then an external reference to the symbol is resolved normally. If a definition of sym1
is not linked, then all references to the weak external for sym1
refer to sym2
instead. The external symbol, sym2
, must always be linked; typically, it is defined in the module that contains the weak reference to sym1
.
Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-3-weak-externals
|
strong |
|
inline |
|
inline |
|
default |
|
default |
|
overridedefault |
|
inline |
|
inlinestatic |
References LIEF::PE::AuxiliarySymbol::type().
|
inlineoverridevirtual |
Reimplemented from LIEF::PE::AuxiliarySymbol.
|
default |
|
default |
|
inline |
|
static |
|
inline |
The symbol-table index of sym2
, the symbol to be linked if sym1
is not found.
|
overridevirtual |
Reimplemented from LIEF::PE::AuxiliarySymbol.