[PECOFF][Writer] Compute the size of a chunk each time it's added rather than all at once.

Contents of ".reloc" section depends on the addresses of other sections, so
the section cannot be created until all the other sections are created and get
their memory addresses (RVAs). That means that computation of section size
needs to be at least two pass.

Techynically there's no reason to compute it all at once, but instead we can
compute the address of a section as added to the output file. Doing so helps
us to create ".reloc" section.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@185902 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF][Writer] Fixed a bug that an empty section is emit to the section header.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@186066 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Support linking against DLL.

This patch adds a new pass, IdataPass, to transform shared atom references
to real references and to construct the .idata section data. With this patch
lld can produce a working Hello World program by linking it against
kernel32.dll and user32.dll.

Reviewers: Bigcheese

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1096

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@186071 91177308-0d34-0410-b5e6-96231b3b80d8