[lld] r196762 - [PECOFF] Simplify WriterPECOFF.
Rui Ueyama
ruiu at google.com
Mon Dec 9 00:47:21 PST 2013
Author: ruiu
Date: Mon Dec 9 02:47:20 2013
New Revision: 196762
URL: http://llvm.org/viewvc/llvm-project?rev=196762&view=rev
Log:
[PECOFF] Simplify WriterPECOFF.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=196762&r1=196761&r2=196762&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Mon Dec 9 02:47:20 2013
@@ -987,11 +987,7 @@ void ExecutableWriter::build(const File
peHeader->setSizeOfUninitializedData(calcSizeOfUninitializedData());
peHeader->setNumberOfSections(_numSections);
peHeader->setSizeOfImage(_imageSizeInMemory);
-
- // The combined size of the DOS, PE and section headers including garbage
- // between the end of the header and the beginning of the first section.
- peHeader->setSizeOfHeaders(dosStub->size() + peHeader->size() +
- sectionTable->size() + dataDirectory->size());
+ peHeader->setSizeOfHeaders(sectionTable->fileOffset() + sectionTable->size());
setAddressOfEntryPoint(text, peHeader);
}
More information about the llvm-commits
mailing list