diff options
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCStreamer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp index 27d0355bb11..3db23455404 100644 --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -669,6 +669,12 @@ void MCStreamer::SwitchSection(const MCSection *Section, MCSectionSubPair curSection = SectionStack.back().first; SectionStack.back().second = curSection; if (MCSectionSubPair(Section, Subsection) != curSection) { + const MCSection *CurSec = curSection.first; + if (CurSec && CurSec->isUnique()) { + MCSymbol *Sym = curSection.first->getEndSymbol(Context); + if (!Sym->isInSection()) + EmitLabel(Sym); + } SectionStack.back().first = MCSectionSubPair(Section, Subsection); assert(!Section->hasEnded() && "Section already ended"); ChangeSection(Section, Subsection); |