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

Eric Bentura ebentura at gmail.com
Mon Jul 13 05:41:05 PDT 2015


Hi,
I have kept working on this and found the following (as llvm 3.5):
1) In the function MCObjectStreamer::EmitInstruction there is a check for
the instruction being relaxable or not:
 if (!Assembler.getBackend().mayNeedRelaxation(Inst)) {
    EmitInstToData(Inst, STI);
    return;
  }
At this stage, the instruction as been already selected to be ARM::ADR.
The call to mayNeed


2015-07-07 18:06 GMT+03:00 Tim Northover <t.p.northover at gmail.com>:

> On 7 July 2015 at 06:06, Eric Bentura <ebentura at gmail.com> wrote:
> > I have created a small ll file to reproduce the problem.
> > I used the intrinsic function llvm.arm.space to introduce space between
> the
> > beginning of the code and the jump table.
>
> It does look like the value in @llvm.arm.space is interpreted
> incorrectly if it's bigger than INT_MAX, but that's well outside its
> intended range and could inevitably be used to break ConstantIslands
> (the longest ARM immediate branch is 26-bits; no indivisible entity in
> .text can be bigger than that). It's probably an unrelated issue.
>
> Also, I know I said the backend should accept any size code, but 2GB
> is definitely going to trigger more edge cases than average.
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150713/602e32d9/attachment.html>


More information about the llvm-dev mailing list