Fix thinko: put stuff with both global and local relocations into data.rel{.ro},...
authorAnton Korobeynikov <asl@math.spbu.ru>
Mon, 30 Mar 2009 17:37:43 +0000 (17:37 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Mon, 30 Mar 2009 17:37:43 +0000 (17:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68036 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ELFTargetAsmInfo.cpp

index 3d24c023c63fb016c529d14cc6bfd38f5278e507..6bf7fd693b55375256b5fcdd551e16ca3f76a24e 100644 (file)
@@ -58,11 +58,11 @@ ELFTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
     bool isConstant = GVar->isConstant();
     unsigned Reloc = RelocBehaviour();
     if (Reloc != Reloc::None && C->ContainsRelocations(Reloc))
-      return (C->ContainsRelocations(Reloc::Local) ?
+      return (C->ContainsRelocations(Reloc::Global) ?
               (isConstant ?
-               SectionKind::DataRelROLocal : SectionKind::DataRelLocal) :
+               SectionKind::DataRelRO : SectionKind::DataRel) :
               (isConstant ?
-               SectionKind::DataRelRO : SectionKind::DataRel));
+               SectionKind::DataRelROLocal : SectionKind::DataRelLocal));
   }
 
   return Kind;