[LLVMdev] ARM Jump table pcrelative relaxation in clang / llc

Eric Bentura ebentura at gmail.com
Sun Jul 5 07:22:23 PDT 2015


Hi,

I have written a PassManager (IR) pass that seriously increases the size of
the original IR code.
As a result it seems that the generated machine code is incorrect (as of
LLVM 3.5): The AsmPrinter generates the following instruction :
adr r2, .LJTI4_0_0
when going through the MC streamer, I get a "fatal error: error in backend:
out of range pc-relative fixup" .
Apparently, the fixup does not hold in the 12 bits we have available. I
would have expected clang to perform relaxation on this instruction on that
particular case. Using the flag mrelax-all does not help.
Is there a way in the PassManager::runOnFunction to anticipate that so that
I can generate a IR code that would fit when converted to machine code?
Strangely enough, this is not happening when using llc to generate the code
from the bc file, I get the object file.
The target is armv5e-none-linux-androideabi ( I used -mtriple with llc).
I have seen a similar thread in 2012 " Questions on MachineFunctionPass and
relaxation of pcrel calls (ARM/thumb2)". Even though there have been
improvements since them, I am concerned with the difference of behavior of
the two tools.

Thanks for your help.

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150705/1c72df3e/attachment.html>


More information about the llvm-dev mailing list