Refactor ElfWriter and introduce ElfWriterQuick

Change-Id: I3eaa1fa1085bb4d28fe342a7420272720e48274b
diff --git a/src/compiler/dex/write_elf.cc b/src/compiler/dex/write_elf.cc
index acec531..d9e45a9 100644
--- a/src/compiler/dex/write_elf.cc
+++ b/src/compiler/dex/write_elf.cc
@@ -14,9 +14,16 @@
  * limitations under the License.
  */
 
-#include "elf_writer.h"
+#include "elf_fixup.h"
+#include "elf_stripper.h"
 #include "os.h"
 
+#if defined(ART_USE_PORTABLE_COMPILER)
+#include "elf_writer_mclinker.h"
+#else
+#include "elf_writer_quick.h"
+#endif
+
 namespace art {
 class CompilerDriver;
 class DexFile;
@@ -29,10 +36,14 @@
                          std::vector<uint8_t>& oat_contents,
                          art::File* file)
     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
-  return art::ElfWriter::Create(file, oat_contents, dex_files, android_root, is_host, driver);
+#if defined(ART_USE_PORTABLE_COMPILER)
+  return art::ElfWriterMclinker::Create(file, oat_contents, dex_files, android_root, is_host, driver);
+#else
+  return art::ElfWriterQuick::Create(file, oat_contents, dex_files, android_root, is_host, driver);
+#endif
 }
 extern "C" bool FixupElf(art::File* file, uintptr_t oat_data_begin) {
-  return art::ElfWriter::Fixup(file, oat_data_begin);
+  return art::ElfFixup::Fixup(file, oat_data_begin);
 }
 extern "C" void GetOatElfInformation(art::File* file,
                                      size_t& oat_loaded_size,
@@ -40,5 +51,5 @@
   art::ElfWriter::GetOatElfInformation(file, oat_loaded_size, oat_data_offset);
 }
 extern "C" bool StripElf(art::File* file) {
-  return art::ElfWriter::Strip(file);
+  return art::ElfStripper::Strip(file);
 }