Skip to content

Commit 183ddef

Browse files
authored
[MC][ELF] Have an assert catching creating group sections without signatures. (#113553)
1 parent 403e4a2 commit 183ddef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/include/llvm/MC/MCSectionELF.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class MCSectionELF final : public MCSection {
6262
type == ELF::SHT_NOBITS, Begin),
6363
Type(type), Flags(flags), UniqueID(UniqueID), EntrySize(entrySize),
6464
Group(group, IsComdat), LinkedToSym(LinkedToSym) {
65+
assert((!(Flags & ELF::SHF_GROUP) || Group.getPointer()) &&
66+
"Group section without signature!");
6567
if (Group.getPointer())
6668
Group.getPointer()->setIsSignature();
6769
}

0 commit comments

Comments
 (0)