[PATCH] D44963: ELF: Add support for short thunks on ARM.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 10:17:06 PDT 2018


peter.smith added a comment.

Thanks for putting in the effort to doing this, especially updating the tests! This can also apply to AArch64 as well. The only concern that I have right now are whether it is possible to construct an example that oscillates between short and long thunks and would infinite loop if it were not for the iteration count. In general transitioning from a short thunk to a large thunk will increase the distance between sections, however there is one case where adding a thunk, or increasing the distance can shorten a distance.

  OS1 : { *(some sections) }
  OS2 0x2000000 : { *(some more sections) }

If in OS1 the ThunkSection size increases then the gap between the InputSections following it and OS2 will narrow, this might mean that Thunks in OS2 that target OS1 can now be written as short range, which then shrinks the distance between OS1 and the InputSections after the OS2 ThunkSection. I haven't got a test case that provokes this behaviour, neither have I convinced myself that it is impossible. I think that this case could be avoided by never transitioning a thunk from long to short, but I think it will only be worth doing if it is possible to make a failing test case.


https://reviews.llvm.org/D44963





More information about the llvm-commits mailing list