forked from OSchip/llvm-project
Object: ensure that structures are fully defined
Ensure that the unused fields are explicitly stated when defining the types. Add some compile time assertions about the size requirements for the structure types. llvm-svn: 270663
This commit is contained in:
parent
ec90b5d030
commit
7f9a9ebdbc
|
@ -439,20 +439,32 @@ struct coff_aux_function_definition {
|
|||
support::ulittle32_t TotalSize;
|
||||
support::ulittle32_t PointerToLinenumber;
|
||||
support::ulittle32_t PointerToNextFunction;
|
||||
char Unused1[2];
|
||||
};
|
||||
|
||||
static_assert(sizeof(coff_aux_function_definition) == 18,
|
||||
"auxiliary entry must be 18 bytes");
|
||||
|
||||
struct coff_aux_bf_and_ef_symbol {
|
||||
char Unused1[4];
|
||||
support::ulittle16_t Linenumber;
|
||||
char Unused2[6];
|
||||
support::ulittle32_t PointerToNextFunction;
|
||||
char Unused3[2];
|
||||
};
|
||||
|
||||
static_assert(sizeof(coff_aux_bf_and_ef_symbol) == 18,
|
||||
"auxiliary entry must be 18 bytes");
|
||||
|
||||
struct coff_aux_weak_external {
|
||||
support::ulittle32_t TagIndex;
|
||||
support::ulittle32_t Characteristics;
|
||||
char Unused1[10];
|
||||
};
|
||||
|
||||
static_assert(sizeof(coff_aux_weak_external) == 18,
|
||||
"auxiliary entry must be 18 bytes");
|
||||
|
||||
struct coff_aux_section_definition {
|
||||
support::ulittle32_t Length;
|
||||
support::ulittle16_t NumberOfRelocations;
|
||||
|
@ -470,12 +482,19 @@ struct coff_aux_section_definition {
|
|||
}
|
||||
};
|
||||
|
||||
static_assert(sizeof(coff_aux_section_definition) == 18,
|
||||
"auxiliary entry must be 18 bytes");
|
||||
|
||||
struct coff_aux_clr_token {
|
||||
uint8_t AuxType;
|
||||
uint8_t Reserved;
|
||||
support::ulittle32_t SymbolTableIndex;
|
||||
char MBZ[12];
|
||||
};
|
||||
|
||||
static_assert(sizeof(coff_aux_clr_token) == 18,
|
||||
"auxiliary entry must be 18 bytes");
|
||||
|
||||
struct coff_import_header {
|
||||
support::ulittle16_t Sig1;
|
||||
support::ulittle16_t Sig2;
|
||||
|
|
Loading…
Reference in New Issue