> 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. > > JoergHi 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 ? -- Fred
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
> De : Joerg Sonnenberger [mailto:joerg at britannica.bec.de] > > Well, MCFixup is what a relocation is represented as internally. They get > resolved to a fixed value and replaced, if evaluateAsAbsolute is true. >Hi Joerg, Actually it fails to get resolved to a fixed value. When I compile to .o then objdump it I can see that a symbol holding the constant value was created in .rodata.cst4 section. Since it is not in .text section, it sound logical that llvm cannot resolved it at assemble time. Is there a way to tell llvm to put the constant in .text section ? $ cat imm.c int imm32(){ return 0x04050607; } $ llvm-objdump -disassemble -s imm.o [...] Contents of section .rodata.cst4: 0000 07060504 [...]