Index: llvm/lib/Object/WindowsResource.cpp =================================================================== --- llvm/lib/Object/WindowsResource.cpp +++ llvm/lib/Object/WindowsResource.cpp @@ -375,10 +375,10 @@ // We have reached the address of the symbol table. SymbolTableOffset = FileSize; - FileSize += COFF::Symbol16Size; // size of the @feat.00 symbol. - FileSize += 4 * COFF::Symbol16Size; // symbol + aux for each section. - FileSize += Data.size() * COFF::Symbol16Size; // 1 symbol per resource. - FileSize += 4; // four null bytes for the string table. + FileSize += 3 * COFF::Symbol16Size + // @feat.00, .rsrc$1, .rsrc$2 + 2 * sizeof(coff_aux_section_definition) + // first and second aux section + Data.size() * COFF::Symbol16Size + // 1 symbol per resource + 4; // string table (4 nul bytes). } void WindowsResourceCOFFWriter::performSectionOneLayout() {