diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 |
commit | 782067d0278612ee75d024b9b135c221c327e9e8 (patch) | |
tree | a6140557876943cdd800ee997c9317283394b22c /lib/MC/MCSectionELF.cpp | |
parent | 6669eceb008a9f13853b330dc0b099d6386fe879 (diff) | |
download | FreeBSD-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.cpp | 17 |
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; -} |