Do not propagate ELF-specific stuff (data.rel) into other targets. This simplifies code and also ensures correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68032 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 0573a96..4d9ec33 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -220,18 +220,14 @@
unsigned Reloc = RelocBehaviour();
// We already did a query for 'all' relocs, thus - early exits.
- if (Reloc == Reloc::LocalOrGlobal) {
- return (C->ContainsRelocations(Reloc::Local) ?
- SectionKind::DataRelROLocal : SectionKind::DataRelRO);
- } else if (Reloc == Reloc::None)
+ if (Reloc == Reloc::LocalOrGlobal)
+ return SectionKind::Data;
+ else if (Reloc == Reloc::None)
return SectionKind::ROData;
else {
// Ok, target wants something funny. Honour it.
- if (C->ContainsRelocations(Reloc)) {
- return (Reloc == Reloc::Local ?
- SectionKind::DataRelROLocal : SectionKind::DataRelRO);
- } else
- return SectionKind::ROData;
+ return (C->ContainsRelocations(Reloc) ?
+ SectionKind::Data : SectionKind::ROData);
}
} else {
// Check, if initializer is a null-terminated string
@@ -243,18 +239,7 @@
}
// Variable either is not constant or thread-local - output to data section.
- if (isThreadLocal)
- return SectionKind::ThreadData;
-
- if (GVar->hasInitializer()) {
- Constant *C = GVar->getInitializer();
- unsigned Reloc = RelocBehaviour();
- if (Reloc != Reloc::None && C->ContainsRelocations(Reloc))
- return (C->ContainsRelocations(Reloc::Local) ?
- SectionKind::DataRelLocal : SectionKind::DataRel);
- }
-
- return SectionKind::Data;
+ return (isThreadLocal ? SectionKind::ThreadData : SectionKind::Data);
}
unsigned