[PATCH] D41263: Fix size computation in WindowsResourceCOFFWriter::performFileLayout()
Bob Haarman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 14 16:47:40 PST 2017
inglorion added inline comments.
================
Comment at: llvm/lib/Object/WindowsResource.cpp:378
- 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
----------------
The code that actually writes the bytes (and thus needs to match the size we compute here) is in WindowsResourceCOFFWriter::writeSymbolTable(), starting on line 511.
https://reviews.llvm.org/D41263
More information about the llvm-commits
mailing list