put normal data into .data instead of .data.rel on elf systems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77116 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp
index da8ed73..880dfbc 100644
--- a/lib/Target/ELFTargetAsmInfo.cpp
+++ b/lib/Target/ELFTargetAsmInfo.cpp
@@ -49,34 +49,24 @@
 const Section*
 ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
                                          SectionKind Kind) const {
-  if (isa<Function>(GV))
-    return TextSection;
-  
-  const GlobalVariable *GVar = cast<GlobalVariable>(GV);
   switch (Kind.getKind()) {
-  default: llvm_unreachable("Unsuported section kind for global");
-  case SectionKind::BSS:
-    return getBSSSection_();
-  case SectionKind::Data:
-  case SectionKind::DataRel:
-    return DataRelSection;
-  case SectionKind::DataRelLocal:
-    return DataRelLocalSection;
-  case SectionKind::DataRelRO:
-    return DataRelROSection;
-  case SectionKind::DataRelROLocal:
-    return DataRelROLocalSection;
-  case SectionKind::ROData:
-    return getReadOnlySection();
+  default: llvm_unreachable("Unknown section kind");
+  case SectionKind::Text:           return TextSection;
+  case SectionKind::BSS:            return getBSSSection_();
+  case SectionKind::Data:           return DataSection;
+  case SectionKind::DataRel:        return DataRelSection;
+  case SectionKind::DataRelLocal:   return DataRelLocalSection;
+  case SectionKind::DataRelRO:      return DataRelROSection;
+  case SectionKind::DataRelROLocal: return DataRelROLocalSection;
+  case SectionKind::ROData:         return getReadOnlySection();
   case SectionKind::RODataMergeStr:
-    return MergeableStringSection(GVar);
+    return MergeableStringSection(cast<GlobalVariable>(GV));
   case SectionKind::RODataMergeConst: {
-    const Type *Ty = GVar->getInitializer()->getType();
+    const Type *Ty = cast<GlobalVariable>(GV)->getInitializer()->getType();
     const TargetData *TD = TM.getTargetData();
     return getSectionForMergableConstant(TD->getTypeAllocSize(Ty), 0);
   }
   case SectionKind::ThreadData:
-    // ELF targets usually support TLS stuff
     return TLSDataSection;
   case SectionKind::ThreadBSS:
     return TLSBSSSection;