This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Add a new relocation to x86-64/i386 psABIs


On Mon, 18 May 2015, H.J. Lu wrote:

> Yes, we should convert it to
> nop call foo/jmp foo nop
> I implemented it on users/hjl/relax branch in binutils git repo.
> > the insn decoder.  For calls as well of course, but there it might be
> > better to have it before the call.
> >
> I think a nop prefix is better on call.  We won't  mandate "nop call foo"
> in psABI and linker is free to use either a nop prefix or a nop suffix.
> Should we move forward with it?

I think I have only nit-picking left: why call the whole thing relax?  To 
me relax implies some length-changing transformation (like jump target 
relaxing, emitting shorter jumps when in range), but perhaps that's just 
me.  OTOH I can't think of a better name right now.

Then one remark: there's a small interaction between this scheme and 
taking the address of a function.  I _think_ it's all taken care of, but 
just want to make sure it is: the relax scheme must only apply to the 
.got.plt slot, not to the normal .got slot (which must continue to hold 
the final function address), and with the recent sharing you have 
implemented (when both are needed) it must be ensured that also an 
existing RELAX_GOTPCREL reloc doesn't overwrite that .got slot with the 
.plt entry address.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]