From d4339076c64aeef4a9542533abeac2e6c44268e0 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Mon, 9 Dec 2013 08:47:20 +0000 Subject: [PATCH] [PECOFF] Simplify WriterPECOFF. llvm-svn: 196762 --- lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp index bef4bc6d384e..a7f2064bfee5 100644 --- a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp @@ -987,11 +987,7 @@ void ExecutableWriter::build(const File &linkedFile) { 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); }