LLD crash in lld::elf::SectionBase::getOutputSection() #1186
Comments
|
Do I need to apply some patches to reproduce? |
|
@samitolvanen shared a reproduce file with me. lld/ELF/LinkerScript.cpp if (config->relocatable && (isec->flags & SHF_LINK_ORDER)) {
// Merging two SHF_LINK_ORDER sections with different sh_link fields will
// change their semantics, so we only merge them in -r links if they will
// end up being linked to the same output section. The casts are fine
// because everything in the map was created by the orphan placement code.
auto *firstIsec = cast<InputSectionBase>(
cast<InputSectionDescription>(sec->sectionCommands[0])
->sectionBases[0]);
/// If firstIsec does not have the SHF_LINK_ORDER flag, this triggers an assertion error
if (firstIsec->getLinkOrderDep()->getOutputSection() !=
isec->getLinkOrderDep()->getOutputSection())
continue;
}Such a non-SHF_LINK_ORDER |
|
LLD patch: https://reviews.llvm.org/D90200 |
github-actions bot
pushed a commit
to tstellar/llvm-project
that referenced
this issue
Oct 28, 2020
…e a SHF_LINK_ORDER orphan Fixes ClangBuiltLinux/linux#1186 If a non-SHF_LINK_ORDER orphan is added first, `firstIsec->flags & SHF_LINK_ORDER` will be zero and we currently assert when calling `getLinkOrderDep`. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D90200 (cherry picked from commit ae73091)
tstellar
added a commit
to tstellar/llvm-project
that referenced
this issue
Oct 31, 2020
…e a SHF_LINK_ORDER orphan Fixes ClangBuiltLinux/linux#1186 If a non-SHF_LINK_ORDER orphan is added first, `firstIsec->flags & SHF_LINK_ORDER` will be zero and we currently assert when calling `getLinkOrderDep`. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D90200 (cherry picked from commit ae73091)
arichardson
added a commit
to arichardson/llvm-project
that referenced
this issue
Mar 25, 2021
…e a SHF_LINK_ORDER orphan Fixes ClangBuiltLinux/linux#1186 If a non-SHF_LINK_ORDER orphan is added first, `firstIsec->flags & SHF_LINK_ORDER` will be zero and we currently assert when calling `getLinkOrderDep`. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D90200
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I build an arm64 kernel with LTO and dynamic ftrace, and additionally disable LTO for the
arch/arm64/kvm/hyp/vhedirectory, LLD crashes inlld::elf::SectionBase::getOutputSection()when linking vmlinux.o:Here's the kernel patch that I applied to the LTO tree that triggers the crash:
And here's how I configured and built the kernel:
I can reproduce this crash with both LLVM 11 and ToT LLVM, and even if I disable LTO for everything in the
arch/arm64/kvm/hypdirectory.@nickdesaulniers @MaskRay any ideas what goes wrong here and how I can help debug the issue?
The text was updated successfully, but these errors were encountered: