[LLVMdev] Hwo to guess PC-relative offset

Joerg Sonnenberger joerg at britannica.bec.de
Mon Jun 29 06:30:14 PDT 2015


On Mon, Jun 29, 2015 at 01:00:14PM +0000, HEITZMANN Frédéric 218168 wrote:
> Thus, the constant should be stored in .text section, after the load
> instruction, and offset should be computed at compile time (not link time).

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




More information about the llvm-dev mailing list