[LLVMdev] MC JIT on ARM can't generate valid code for external functions call

kursh kursh at ispras.ru
Tue Mar 13 13:19:05 PDT 2012



Instruction BL in the ARM mode can jump by offset +/- 32 MB only. 


If using absolute offset, we need generate a few additional
instructions same as: 

load offset into register and jump to address
from register, or save LR, and load into PC offset. 

But in both cases
change size of code in the function will lead to possibility invalidate
offsets  

computed in the "ARM constant island placement and branch
shortening pass" and we still need 

in the thunk.  

--- 

Kurmangaleev
Shamil 

 13.03.2012 17:47, Joerg Sonnenberger пишет:  

On Tue, Mar 13,
2012 at 05:27:58PM +0400, Shamil Kurmangaleev wrote:

Because the ELF
file in memory generated by MC JIT does not have the
.plt section, but
we need to have the following code to be emitted in it:

Why do you need
it to emit PIC? You know the offsets of all functions it
is
calling.

Joerg
_______________________________________________
LLVM
Developers mailing list
LLVMdev at cs.uiuc.edu [1] http://llvm.cs.uiuc.edu
[2]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev [3]




Links:
------
[1] mailto:LLVMdev at cs.uiuc.edu
[2]
http://llvm.cs.uiuc.edu
[3]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120314/ea508aab/attachment.html>


More information about the llvm-dev mailing list