Index: ELF/InputFiles.cpp =================================================================== --- ELF/InputFiles.cpp +++ ELF/InputFiles.cpp @@ -78,7 +78,9 @@ check(object::ObjectFile::createObjectFile(this->MB), toString(this)); ObjectInfo ObjInfo; - DWARFContextInMemory Dwarf(*Obj, &ObjInfo); + DWARFContextInMemory Dwarf(*Obj, &ObjInfo, false); + if (Dwarf.HasErrors()) + fatal("unable to initialize DWARFContextInMemory for " + toString(this)); DwarfLine.reset(new DWARFDebugLine(&Dwarf.getLineSection().Relocs)); DataExtractor LineData(Dwarf.getLineSection().Data, Config->IsLE, Config->Wordsize); Index: ELF/SyntheticSections.cpp =================================================================== --- ELF/SyntheticSections.cpp +++ ELF/SyntheticSections.cpp @@ -1789,7 +1789,11 @@ return {}; } - DWARFContextInMemory Dwarf(*Obj.get()); + DWARFContextInMemory Dwarf(*Obj.get(), nullptr /*LoadedObjectInfo*/, + false /*AllowErrors*/); + if (Dwarf.HasErrors()) + fatal("unable to initialize DWARFContextInMemory for " + + toString(Sec->File)); GdbIndexChunk Ret; Ret.CompilationUnits = readCuList(Dwarf, Sec);