aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 7a93a26..ac7c4c5 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -586,30 +586,15 @@ MCSection *TargetLoweringObjectFileELF::getExplicitSectionGlobal(
Flags |= ELF::SHF_GROUP;
}
- bool EmitUniqueSection = false;
-
- // If we have -ffunction-sections or -fdata-sections then we should emit the
- // global value to a uniqued section of the same name.
- if (!(Flags & ELF::SHF_MERGE) && !Kind.isCommon()) {
- if (Kind.isText())
- EmitUniqueSection = TM.getFunctionSections();
- else
- EmitUniqueSection = TM.getDataSections();
- }
- EmitUniqueSection |= GO->hasComdat();
-
// A section can have at most one associated section. Put each global with
// MD_associated in a unique section.
+ unsigned UniqueID = MCContext::GenericSectionID;
const MCSymbolELF *AssociatedSymbol = getAssociatedSymbol(GO, TM);
if (AssociatedSymbol) {
- EmitUniqueSection = true;
+ UniqueID = NextUniqueID++;
Flags |= ELF::SHF_LINK_ORDER;
}
- unsigned UniqueID = MCContext::GenericSectionID;
- if (EmitUniqueSection)
- UniqueID = NextUniqueID++;
-
MCSectionELF *Section = getContext().getELFSection(
SectionName, getELFSectionType(SectionName, Kind), Flags,
getEntrySizeForKind(Kind), Group, UniqueID, AssociatedSymbol);