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 } |
Public Types inherited from LIEF::COFF::AuxiliarySymbol | |
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 | |
Public Member Functions inherited from LIEF::COFF::AuxiliarySymbol | |
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. | |
template<class T> | |
T * | as () |
Static Public Member Functions | |
static std::unique_ptr< AuxiliaryWeakExternal > | parse (const std::vector< uint8_t > &payload) |
static bool | classof (const AuxiliarySymbol *sym) |
Static Public Member Functions inherited from LIEF::COFF::AuxiliarySymbol | |
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 |
References LIEF::COFF::AuxiliarySymbol::AuxiliarySymbol(), and LIEF::COFF::AuxiliarySymbol::WEAK_EXTERNAL.
Referenced by AuxiliaryWeakExternal(), AuxiliaryWeakExternal(), clone(), operator=(), and operator=().
|
inline |
|
default |
References AuxiliaryWeakExternal().
|
default |
References AuxiliaryWeakExternal().
|
overridedefault |
|
inline |
Referenced by AuxiliaryWeakExternal().
|
inlinestatic |
|
inlineoverridevirtual |
Reimplemented from LIEF::COFF::AuxiliarySymbol.
References AuxiliaryWeakExternal().
|
default |
References AuxiliaryWeakExternal().
|
default |
References AuxiliaryWeakExternal().
|
inline |
Referenced by AuxiliaryWeakExternal().
|
static |
References LIEF::COFF::AuxiliarySymbol::payload().
|
inline |
The symbol-table index of sym2, the symbol to be linked if sym1 is not found.
Referenced by AuxiliaryWeakExternal().
|
overridevirtual |
Reimplemented from LIEF::COFF::AuxiliarySymbol.