[llvm-dev] Building llvm with clang and lld on arm and the llvm arm backend relocation on position independent code

Alessandro Pistocchi via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 30 02:13:18 PDT 2017

Hi Rafael,

The error was R_ARM_CALL, not R_ARM_THM_MOVW_ABS_NC.


Sent from my iPhone

> On 30 Jun 2017, at 02:49, Rafael Avila de Espindola <rafael.espindola at gmail.com> wrote:
> Peter Smith via llvm-dev <llvm-dev at lists.llvm.org> writes:
>> Hello Alessandro,
>> Despite the statement in the HowToCrossCompileLLVM guide "If you’re
>> using Clang as the cross-compiler, there is a problem in the LLVM ARM
>> back-end that is producing absolute relocations on
>> position-independent code (R_ARM_THM_MOVW_ABS_NC), so for now, you
>> should disable PIC:" I can't find an existing upstream PR or any
>> record that this has been fixed. If the ARM backend is still producing
>> an R_ARM_THM_MOVW_ABS_NC relocation when -fpic is given as an option
>> then it would be great to get a small reproducible example in a new
>> PR, or if there is one already to update it.
> I am pretty sure we don't try using movw/movt with pic on ELF:
> https://bugs.llvm.org/show_bug.cgi?id=28229
> Cheers,
> Rafael

More information about the llvm-dev mailing list