Decouple virtual memory allocation in ElfBuilder.

Multi-boot-image requires knowing the loaded size ahead of time,
and calculating that size ended up being fairly hacky.

Decouple allocation of virtual memory and allocation of file space,
so that we have more flexibility when we do those.

Test: The generated boot image is bit-for-bit identical as before.

Change-Id: I012b55a71e7625f2310570f9b91447c9db73578b
diff --git a/dex2oat/linker/elf_writer_quick.cc b/dex2oat/linker/elf_writer_quick.cc
index 5fc33dd..758e21d 100644
--- a/dex2oat/linker/elf_writer_quick.cc
+++ b/dex2oat/linker/elf_writer_quick.cc
@@ -173,6 +173,7 @@
 void ElfWriterQuick<ElfTypes>::Start() {
   builder_->Start();
   if (compiler_options_->GetGenerateBuildId()) {
+    builder_->GetBuildId()->AllocateVirtualMemory(builder_->GetBuildId()->GetSize());
     builder_->WriteBuildIdSection();
   }
 }
@@ -225,9 +226,6 @@
 
 template <typename ElfTypes>
 void ElfWriterQuick<ElfTypes>::WriteDynamicSection() {
-  if (bss_size_ != 0u) {
-    builder_->GetBss()->WriteNoBitsSection(bss_size_);
-  }
   if (builder_->GetIsa() == InstructionSet::kMips ||
       builder_->GetIsa() == InstructionSet::kMips64) {
     builder_->WriteMIPSabiflagsSection();