Use a default alignment for data and bss sections.
Only pad when the section size > 0 and move the code that deals
with globals initializers to a place we know for sure the global
is initialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73944 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/ELFWriter.h b/lib/CodeGen/ELFWriter.h
index ae3939f..39577d9 100644
--- a/lib/CodeGen/ELFWriter.h
+++ b/lib/CodeGen/ELFWriter.h
@@ -171,14 +171,18 @@
       return getSection(".strtab", ELFSection::SHT_STRTAB, 0, 1);
     }
 
+    ELFSection &getSectionHeaderStringTableSection() {
+      return getSection(".shstrtab", ELFSection::SHT_STRTAB, 0, 1);
+    }
+
     ELFSection &getDataSection() {
       return getSection(".data", ELFSection::SHT_PROGBITS,
-                        ELFSection::SHF_WRITE | ELFSection::SHF_ALLOC);
+                        ELFSection::SHF_WRITE | ELFSection::SHF_ALLOC, 4);
     }
 
     ELFSection &getBSSSection() {
       return getSection(".bss", ELFSection::SHT_NOBITS,
-                        ELFSection::SHF_WRITE | ELFSection::SHF_ALLOC);
+                        ELFSection::SHF_WRITE | ELFSection::SHF_ALLOC, 4);
     }
 
     ELFSection &getNullSection() {