[PATCH] D53003: [ELF] Fix link failure with Android compressed relocation support.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 9 02:39:44 PDT 2018


peter.smith added a comment.

> FWIW: I fixed a similar issue in the LLVM assembler with the exception table: https://reviews.llvm.org/D42722
> 
> I wonder if a non-contrived input could require more than 10 rounds to converge. It seems unlikely to happen, at least.
> 
> This change seems fine to me.

I think that this change makes sense as well. The Thunks code has to be careful with Short branch selection in order to not oscillate between short and long branches. One thing that may be worth doing (not necessarily in this patch) is to make the error message less specific to Thunks, and potentially extract it from the Thunks code. At the moment all the Targets supporting packed relocations also support Thunks but this might always be the case.

I had originally chosen 10 for the pass limit for Thunks based on the relative sizes of the Thunks and the Thumb 1 branch range, and the practical experience of never seeing a working program go past 5 passes. Anything that had reached 10 had always been a bug. I suspect that a similar calculation could be done for the relocation packer if we were worried that 10 might not be enough.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D53003





More information about the llvm-commits mailing list