diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -1192,13 +1192,6 @@ for (auto I = Rels.begin(), End = Rels.end(); I != End;) scanReloc(Sec, GetOffset, I, End); - - // Sort relocations by offset to binary search for R_RISCV_PCREL_HI20 - if (Config->EMachine == EM_RISCV) - std::stable_sort(Sec.Relocations.begin(), Sec.Relocations.end(), - [](const Relocation &LHS, const Relocation &RHS) { - return LHS.Offset < RHS.Offset; - }); } template void elf::scanRelocations(InputSectionBase &S) {