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