[PATCH] D34690: [LLD][ELF] Introduce target specific inBranchRange() function

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 02:21:31 PDT 2017


peter.smith added a comment.

My preference is to be precise as I think it makes reasoning about the behavior of the linker easier. From experience with ARM's proprietary linker, which got progressively more precise the main benefits were:

- Being precise means that the same range measurement function can be used in multiple places and is consistent with the relocation range check.
- It makes it simpler to write test cases at the extremes of range, and also to explain to users why the linker has generated a range-thunk when the branch should have been in range. This is not a problem for Linux like systems, but is important in embedded systems with non-contiguous memory.

-It makes it simpler to track down bugs, as this feature is most likely to trigger with large complicated test cases that users are often reluctant to share. Having the range match the relocation overflow check is useful in ruling out some problems.

In summary I think it is worth going to the extra effort here although the benefits are more long-term.


https://reviews.llvm.org/D34690





More information about the llvm-commits mailing list