This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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


Hi,

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

> To avoid indirect branch to internal functions, I am proposing to add a
> new relocation, R_X86_64_RELAX_GOTPCREL, to x86-64 psABI:
> 
> 1. When branching to an external function, foo, compiler may generate
> 	call/jmp *foo@GOTRELAX(%rip)
>    which generates R_X86_64_RELAX_GOTPCREL relocation, instead of
> 	call/jmp foo[@PLT]
> 2. When function foo is locally defined, linker converts
> 	call/jmp *foo@GOTRELAX(%rip)
>    to
> 	nop call/jmp foo

For the jmp case the nop can also be added after it, to not even disturb 
the insn decoder.  For calls as well of course, but there it might be 
better to have it before the call.


Ciao,
Michael.


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