diff --git a/llvm/include/llvm/MC/MCSectionELF.h b/llvm/include/llvm/MC/MCSectionELF.h index d43ffbd885c961..f09d30591a3cf6 100644 --- a/llvm/include/llvm/MC/MCSectionELF.h +++ b/llvm/include/llvm/MC/MCSectionELF.h @@ -62,6 +62,8 @@ class MCSectionELF final : public MCSection { type == ELF::SHT_NOBITS, Begin), Type(type), Flags(flags), UniqueID(UniqueID), EntrySize(entrySize), Group(group, IsComdat), LinkedToSym(LinkedToSym) { + assert((!(Flags & ELF::SHF_GROUP) || Group.getPointer()) && + "Group section without signature!"); if (Group.getPointer()) Group.getPointer()->setIsSignature(); }