summaryrefslogtreecommitdiffstats
path: root/lib/MC/MCSectionELF.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-27 18:44:32 +0000
committerdim <dim@FreeBSD.org>2015-05-27 18:44:32 +0000
commit782067d0278612ee75d024b9b135c221c327e9e8 (patch)
treea6140557876943cdd800ee997c9317283394b22c /lib/MC/MCSectionELF.cpp
parent6669eceb008a9f13853b330dc0b099d6386fe879 (diff)
downloadFreeBSD-src-782067d0278612ee75d024b9b135c221c327e9e8.zip
FreeBSD-src-782067d0278612ee75d024b9b135c221c327e9e8.tar.gz
Vendor import of llvm trunk r238337:
https://llvm.org/svn/llvm-project/llvm/trunk@238337
Diffstat (limited to 'lib/MC/MCSectionELF.cpp')
-rw-r--r--lib/MC/MCSectionELF.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/MC/MCSectionELF.cpp b/lib/MC/MCSectionELF.cpp
index a29bb97..3cd8453 100644
--- a/lib/MC/MCSectionELF.cpp
+++ b/lib/MC/MCSectionELF.cpp
@@ -24,6 +24,9 @@ MCSectionELF::~MCSectionELF() {} // anchor.
bool MCSectionELF::ShouldOmitSectionDirective(StringRef Name,
const MCAsmInfo &MAI) const {
+ if (isUnique())
+ return false;
+
// FIXME: Does .section .bss/.data/.text work everywhere??
if (Name == ".text" || Name == ".data" ||
(Name == ".bss" && !MAI.usesELFSectionDirectiveForBSS()))
@@ -144,6 +147,10 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI,
printName(OS, Group->getName());
OS << ",comdat";
}
+
+ if (isUnique())
+ OS << ",unique," << UniqueID;
+
OS << '\n';
if (Subsection)
@@ -157,13 +164,3 @@ bool MCSectionELF::UseCodeAlign() const {
bool MCSectionELF::isVirtualSection() const {
return getType() == ELF::SHT_NOBITS;
}
-
-unsigned MCSectionELF::DetermineEntrySize(SectionKind Kind) {
- if (Kind.isMergeable1ByteCString()) return 1;
- if (Kind.isMergeable2ByteCString()) return 2;
- if (Kind.isMergeable4ByteCString()) return 4;
- if (Kind.isMergeableConst4()) return 4;
- if (Kind.isMergeableConst8()) return 8;
- if (Kind.isMergeableConst16()) return 16;
- return 0;
-}
OpenPOWER on IntegriCloud