diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -405,6 +405,7 @@ StringRef Group = ""; if (GroupSym) Group = GroupSym->getName(); + assert(!(LinkedToSym && LinkedToSym->getName().empty())); // Do the lookup, if we have a hit, return it. auto IterBool = ELFUniquingMap.insert(std::make_pair( ELFSectionKey{Section.str(), Group, diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp @@ -1201,7 +1201,7 @@ Flags |= ELF::SHF_GROUP; MCSectionELF *EHSection = getContext().getELFSection( EHSecName, Type, Flags, 0, Group, FnSection.getUniqueID(), - static_cast(&Fn)); + static_cast(FnSection.getBeginSymbol())); assert(EHSection && "Failed to get the required EH section");