[PATCH] D55505: [LLD][ELF] Implement option to force PIC compatible Thunks

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 2 11:13:22 PST 2019


peter.smith added a comment.

In D55505#1342203 <https://reviews.llvm.org/D55505#1342203>, @falstaff84 wrote:

> In my test case using Linux compiled for Arm using allyesconfig and ld.lld with these changes applied linking fails as follows:
>
>   ...
>   ld.lld: error: relocation R_ARM_MOVT_PREL out of range: -4403772844 is not in [-2147483648, 2147483647]
>   ...
>
>
> I guess this is since we are using `R_ARM_MOVT_PREL` in ARMV7PILongThunk. Not sure whether we really care as this is more a constructed case with an insanely big kernel (with ld.bfd the linked kernel ends up at 201MiB!).
>
> ld.bfd seems to use a different approach which allows the kernel to successfully link. See also:
>  https://lore.kernel.org/patchwork/patch/1021192/#1213770


I'll address the MOVT/MOVW relocation overflow when I get back to the office on Monday. At a first pass I think the overflow calculation for MOVT/MOVW isn't permissive enough, at least when used from the thunks. In any case I'll use a separate patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55505/new/

https://reviews.llvm.org/D55505





More information about the llvm-commits mailing list