From: Rui Ueyama Date: Wed, 31 Jul 2013 17:45:48 +0000 (+0000) Subject: [PECOFF] Add a comment about .bss section. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3361fa49f5b110a36cf10be3800e15566c53bf19;p=platform%2Fupstream%2Fllvm.git [PECOFF] Add a comment about .bss section. llvm-svn: 187505 --- diff --git a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp index 64a1f6c..d7d8176 100644 --- a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp @@ -579,6 +579,15 @@ private: }; // \brief A BSSSectionChunk represents a .bss section. +// +// Seems link.exe does not emit .bss section but instead merges it with .data +// section. In COFF, if the size of the section in the header is greater than +// the size of the actual data on disk, the section on memory is zero-padded. +// That's why .bss can be merge with .data just by appending it at the end of +// the section. +// +// The executable with .bss is also valid and easier to understand. So we chose +// to create .bss in LLD. class BssSectionChunk : public SectionChunk { public: // BSS section does not have contents, so write should be no-op.