Index: include/llvm/MC/MCELFStreamer.h =================================================================== --- include/llvm/MC/MCELFStreamer.h +++ include/llvm/MC/MCELFStreamer.h @@ -81,6 +81,9 @@ void EmitBundleLock(bool AlignToEnd) override; void EmitBundleUnlock() override; + MCSection *getNamedGroupSection(StringRef Section, StringRef Identifer, + unsigned EntSize) override; + private: bool isBundleLocked() const; void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &) override; Index: include/llvm/MC/MCStreamer.h =================================================================== --- include/llvm/MC/MCStreamer.h +++ include/llvm/MC/MCStreamer.h @@ -760,6 +760,12 @@ /// Get the .xdata section used for the given section. MCSection *getAssociatedXDataSection(const MCSection *TextSec); + /// Get a group section with provided group identifier. This is in ELF, for + /// instance, named by concatenating \p Section with '.' then \p Identifier. + virtual MCSection *getNamedGroupSection(StringRef Section, + StringRef Identifier, + unsigned EntSize); + virtual void EmitSyntaxDirective(); /// \brief Emit a .reloc directive. Index: lib/MC/MCELFStreamer.cpp =================================================================== --- lib/MC/MCELFStreamer.cpp +++ lib/MC/MCELFStreamer.cpp @@ -672,3 +672,11 @@ uint64_t Size, unsigned ByteAlignment) { llvm_unreachable("ELF doesn't support this directive"); } + +MCSection *MCELFStreamer::getNamedGroupSection(StringRef Section, + StringRef Identifier, + unsigned EntSize) { + return getContext().getELFSection(Section, ELF::SHT_PROGBITS, + ELF::SHF_ALLOC | ELF::SHF_GROUP, EntSize, + Identifier); +} Index: lib/MC/MCStreamer.cpp =================================================================== --- lib/MC/MCStreamer.cpp +++ lib/MC/MCStreamer.cpp @@ -806,3 +806,8 @@ EmitLabel(Sym); return Sym; } + +MCSection *MCStreamer::getNamedGroupSection(StringRef, StringRef, unsigned) { + llvm_unreachable("Unimplemented."); + return nullptr; +}