test optional header fields

This commit is contained in:
Nikita Smith
2025-06-25 10:53:24 -07:00
committed by Ryan Fleury
parent fe967a3d36
commit 25710d39b7
4 changed files with 69 additions and 5 deletions
+3 -3
View File
@@ -2005,11 +2005,11 @@ lnk_build_win32_header(Arena *arena, LNK_SymbolTable *symtab, LNK_Config *config
if (sect->flags & COFF_SectionFlag_CntUninitializedData) {
sizeof_uninited_data += sect->vsize;
}
if (sect->flags & COFF_SectionFlag_CntInitializedData) {
sizeof_inited_data += sect->vsize;
if ((sect->flags & COFF_SectionFlag_CntInitializedData) || (sect->flags & COFF_SectionFlag_CntCode)) {
sizeof_inited_data += sect->fsize;
}
if (sect->flags & COFF_SectionFlag_CntCode) {
sizeof_code += sect->vsize;
sizeof_code += sect->fsize;
}
sizeof_image = Max(sizeof_image, sects.v[sect_idx]->voff + sects.v[sect_idx]->vsize);
}