aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2019-08-07 20:45:23 +0000
committerBob Haarman <llvm@inglorion.net>2019-08-07 20:45:23 +0000
commit885fa02da97a9f4d15f05fd7ec9c1358c47dd125 (patch)
tree19ccc7133fcd2c1007a4fcf5d8835453a0fd36f9 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent762e662582dd9258626ee922b2852b5e44701004 (diff)
downloadllvm-885fa02da97a9f4d15f05fd7ec9c1358c47dd125.zip
llvm-885fa02da97a9f4d15f05fd7ec9c1358c47dd125.tar.gz
llvm-885fa02da97a9f4d15f05fd7ec9c1358c47dd125.tar.bz2
Revert r367501 "Create unique, but identically-named ELF sections..."
This reverts commit fbc563e2cb6c5f1d0200b390513506b6aca4d2e9 "Create unique, but identically-named ELF sections for explicitly-sectioned functions and globals when using -function-sections and -data-sections." Reason for revert: sections are created with potentially wrong attributes. llvm-svn: 368204
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);