Index: lld/trunk/ELF/GdbIndex.cpp =================================================================== --- lld/trunk/ELF/GdbIndex.cpp +++ lld/trunk/ELF/GdbIndex.cpp @@ -79,11 +79,13 @@ Optional LLDDwarfObj::findAux(const InputSectionBase &Sec, uint64_t Pos, ArrayRef Rels) const { - auto I = llvm::find_if(Rels, - [=](const RelTy &Rel) { return Rel.r_offset == Pos; }); - if (I == Rels.end()) + auto It = std::lower_bound( + Rels.begin(), Rels.end(), Pos, + [](const RelTy &A, uint64_t B) { return A.r_offset < B; }); + if (It == Rels.end() || It->r_offset != Pos) return None; - const RelTy &Rel = *I; + const RelTy &Rel = *It; + const ObjFile *File = Sec.getFile(); uint32_t SymIndex = Rel.getSymbol(Config->IsMips64EL); const typename ELFT::Sym &Sym = File->getELFSymbols()[SymIndex];