LIEF: Library to Instrument Executable Formats Version 0.17.0
|
This auxiliary symbol exposes information about the associated section. More...
#include <AuxiliarySectionDefinition.hpp>
Public Types | |
enum class | COMDAT_SELECTION : uint8_t { NONE = 0 , NODUPLICATES = 1 , ANY , SAME_SIZE , EXACT_MATCH , ASSOCIATIVE , LARGEST } |
Values for the AuxiliarySectionDefinition::selection attribute. More... | |
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 | |
AuxiliarySectionDefinition () | |
AuxiliarySectionDefinition (uint32_t length, uint16_t nb_relocs, uint16_t nb_lines, uint32_t checksum, uint32_t sec_idx, uint8_t selection, uint8_t reserved) | |
AuxiliarySectionDefinition (const AuxiliarySectionDefinition &)=default | |
AuxiliarySectionDefinition & | operator= (const AuxiliarySectionDefinition &)=default |
AuxiliarySectionDefinition (AuxiliarySectionDefinition &&)=default | |
AuxiliarySectionDefinition & | operator= (AuxiliarySectionDefinition &&)=default |
std::unique_ptr< AuxiliarySymbol > | clone () const override |
uint32_t | length () const |
The size of section data. The same as SizeOfRawData in the section header. | |
uint16_t | nb_relocs () const |
The number of relocation entries for the section. | |
uint16_t | nb_line_numbers () const |
The number of line-number entries for the section. | |
uint32_t | checksum () const |
The checksum for communal data. It is applicable if the IMAGE_SCN_LNK_COMDAT flag is set in the section header. | |
uint32_t | section_idx () const |
One-based index into the section table for the associated section. This is used when the COMDAT selection setting is 5. | |
COMDAT_SELECTION | selection () const |
The COMDAT selection number. This is applicable if the section is a COMDAT section. | |
uint8_t | reserved () const |
Reserved value (should be 0). | |
std::string | to_string () const override |
~AuxiliarySectionDefinition () 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< AuxiliarySectionDefinition > | 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) |
This auxiliary symbol exposes information about the associated section.
It duplicates some information that are provided in the section header
|
strong |
Values for the AuxiliarySectionDefinition::selection attribute.
See: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only
Enumerator | |
---|---|
NONE | |
NODUPLICATES | If this symbol is already defined, the linker issues a multiply defined symbol error. |
ANY | Any section that defines the same COMDAT symbol can be linked; the rest are removed. |
SAME_SIZE | The linker chooses an arbitrary section among the definitions for this symbol. If all definitions are not the same size, a multiply defined symbol error is issued. |
EXACT_MATCH | The linker chooses an arbitrary section among the definitions for this symbol. If all definitions do not match exactly, a multiply defined symbol error is issued. |
ASSOCIATIVE | The section is linked if a certain other COMDAT section is linked. This other section is indicated by the Number field of the auxiliary symbol record for the section definition. This setting is useful for definitions that have components in multiple sections (for example, code in one and data in another), but where all must be linked or discarded as a set. The other section this section is associated with must be a COMDAT section, which can be another associative COMDAT section. An associative COMDAT section's section association chain can't form a loop. The section association chain must eventually come to a COMDAT section that doesn't have COMDAT_SELECTION::ASSOCIATIVE set. |
LARGEST | The linker chooses the largest definition from among all of the definitions for this symbol. If multiple definitions have this size, the choice between them is arbitrary. |
|
inline |
References LIEF::COFF::AuxiliarySymbol::AuxiliarySymbol(), and LIEF::COFF::AuxiliarySymbol::SEC_DEF.
Referenced by AuxiliarySectionDefinition(), AuxiliarySectionDefinition(), clone(), operator=(), and operator=().
|
inline |
|
default |
References AuxiliarySectionDefinition().
|
default |
References AuxiliarySectionDefinition().
|
overridedefault |
References NONE.
|
inline |
The checksum for communal data. It is applicable if the IMAGE_SCN_LNK_COMDAT flag is set in the section header.
Referenced by AuxiliarySectionDefinition().
|
inlinestatic |
|
inlineoverridevirtual |
Reimplemented from LIEF::COFF::AuxiliarySymbol.
References AuxiliarySectionDefinition().
|
inline |
The size of section data. The same as SizeOfRawData in the section header.
Referenced by AuxiliarySectionDefinition().
|
inline |
The number of line-number entries for the section.
|
inline |
The number of relocation entries for the section.
Referenced by AuxiliarySectionDefinition().
|
default |
References AuxiliarySectionDefinition().
|
default |
References AuxiliarySectionDefinition().
|
static |
References LIEF::COFF::AuxiliarySymbol::payload().
|
inline |
Reserved value (should be 0).
Referenced by AuxiliarySectionDefinition().
|
inline |
One-based index into the section table for the associated section. This is used when the COMDAT selection setting is 5.
|
inline |
The COMDAT selection number. This is applicable if the section is a COMDAT section.
Referenced by AuxiliarySectionDefinition().
|
overridevirtual |
Reimplemented from LIEF::COFF::AuxiliarySymbol.