I believe relocations are sorted by offset, so this code is redundant.
We have the same assumption for other targets.
Details
Details
- Reviewers
 PkmX • espindola 
Diff Detail
Diff Detail
- Repository
 - rG LLVM Github Monorepo
 - Build Status
 Buildable 28148 Build 28147: arc lint + arc unit 
Event Timeline
Comment Actions
GNU as for RISC-V does actually produce out-of-order relocations so lld cannot assume they are always sorted by offset. This was previously discussed at:
https://github.com/riscv/riscv-binutils-gdb/issues/107
Some parts of the code in lld like OffsetGetter::get() for merging .eh_frame also depends on the relocations being sorted by offset, so sorting here isn't simply a performance optimization to do binary search.