[LLVMdev] Hwo to guess PC-relative offset

Joerg Sonnenberger joerg at britannica.bec.de
Mon Jun 29 07:36:36 PDT 2015


On Mon, Jun 29, 2015 at 02:23:01PM +0000, HEITZMANN Frédéric 218168 wrote:
> > De : Joerg Sonnenberger [mailto:joerg at britannica.bec.de]
> > 
> > The basic idea is to still create a relocation on the MC level, but fix it up later.
> > You didn't say if your ISA is fixed or variable length, the former, can simplify
> > this quite bit. The constant island pass generally tries to address two issues:
> > (1) Merging of identical constants.
> > (2) Splitting the constant island if the function gets too large.
> > 
> > Joerg
> 
> Hi Joerg,
> 
> ISA is actually fixed length.
> If I get it right, unless the function gets too big,
> I could at least have a suboptimal thus functional binary, without the constant island pass.
> Could you spot the hook(s) I should use add a relocation (or do you mean fixup ?) and where I should fix it ?

Well, MCFixup is what a relocation is represented as internally. They
get resolved to a fixed value and replaced, if evaluateAsAbsolute is
true.

Joerg




More information about the llvm-dev mailing list