Write out global initializers and data rel directly to ELF file.

The local symbol relocations are a bit different from
llvm-mc, which are section-relative. E.g., instead "bytes",
it will be ".data + offsetof(bytes, .data)". So the
contents of the text/data/rodata sections can also differ
since the offsets written in place are different.

Still need to fill the symbol table with undefined
symbols (e.g., memset, and szrt lib functions) before
trying to link.

BUG=none
R=kschimpf@google.com, stichnot@chromium.org

Review URL: https://codereview.chromium.org/874353006
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h
index 17d785e..2dda5c5 100644
--- a/src/IceTargetLowering.h
+++ b/src/IceTargetLowering.h
@@ -238,23 +238,24 @@
   LoweringContext Context;
 };
 
-// TargetGlobalLowering is used for "lowering" global initializers,
-// including the internal constant pool.  It is separated out from
-// TargetLowering because it does not require a Cfg.
-class TargetGlobalLowering {
-  TargetGlobalLowering() = delete;
-  TargetGlobalLowering(const TargetGlobalLowering &) = delete;
-  TargetGlobalLowering &operator=(const TargetGlobalLowering &) = delete;
+// TargetDataLowering is used for "lowering" data including initializers
+// for global variables, and the internal constant pools.  It is separated
+// out from TargetLowering because it does not require a Cfg.
+class TargetDataLowering {
+  TargetDataLowering() = delete;
+  TargetDataLowering(const TargetDataLowering &) = delete;
+  TargetDataLowering &operator=(const TargetDataLowering &) = delete;
 
 public:
-  static TargetGlobalLowering *createLowering(GlobalContext *Ctx);
-  virtual ~TargetGlobalLowering();
+  static TargetDataLowering *createLowering(GlobalContext *Ctx);
+  virtual ~TargetDataLowering();
 
-  virtual void lowerInit(const VariableDeclaration &Var) const = 0;
+  virtual void lowerGlobal(const VariableDeclaration &Var) const = 0;
+  virtual void lowerGlobalsELF(const VariableDeclarationList &Vars) const = 0;
   virtual void lowerConstants(GlobalContext *Ctx) const = 0;
 
 protected:
-  TargetGlobalLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
+  TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
   GlobalContext *Ctx;
 };