diff options
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r-- | lld/ELF/InputSection.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 58c3513aeff..0ed3a70156f 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -1224,11 +1224,9 @@ SectionPiece *MergeInputSection::getSectionPiece(uint64_t Offset) { // If Offset is not at beginning of a section piece, it is not in the map. // In that case we need to do a binary search of the original section piece vector. - auto It2 = - llvm::upper_bound(Pieces, Offset, [](uint64_t Offset, SectionPiece P) { - return Offset < P.InputOff; - }); - return &It2[-1]; + auto It = llvm::bsearch(Pieces, + [=](SectionPiece P) { return Offset < P.InputOff; }); + return &It[-1]; } // Returns the offset in an output section for a given input offset. |