[llvm-dev] armv7 pc-rel bx thumb instruction

Jonas Devlieghere via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 26 10:52:43 PDT 2017

Hi everyone,

I'm working on some custom transformation passes that have the side-effect
significantly increasing the code size. While testing it on some larger,
real-world code bases, I run into a linker error for armv7 thumb code. The
particular error I get from ld64 is that "armv7 has no pc-rel bx thumb
instruction." I've been able to reproduce the problem by taking a random
thumbv7 bitcode file and cloning functions until the linker fails.

>From looking at the ld64 source code it seems that the problem is caused by
the relocation for a thumb 22-bit pc-rel branch. I'm guessing that the
is unable to perform the relocation because the new address doesn't fit in
instruction's 22 bits.

I know very little about the arm backend, but I'm wondering if there's
I can do to prevent this from happening during compilation, before the
is involved?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170726/eaa77638/attachment.html>

More information about the llvm-dev mailing list