Index: ELF/SyntheticSections.cpp =================================================================== --- ELF/SyntheticSections.cpp +++ ELF/SyntheticSections.cpp @@ -2322,6 +2322,8 @@ ArrayRef Sections = Sec->File->getSections(); for (DWARFAddressRange &R : Ranges) { + if (R.SectionIndex == UINT64_C(-1)) + continue; InputSectionBase *S = Sections[R.SectionIndex]; if (!S || S == &InputSection::Discarded || !S->Live) continue;