This is the mail archive of the binutils@sources.redhat.com 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: [PATCH] Clearing st_value of PLT SHN_UNDEF symbols if pointer equality not needed for x86-64


On Thu, Apr 22, 2004 at 03:31:16PM +0200, Jakub Jelinek wrote:
> Hi!
> 
> This is a x86-64 version of my 2003-11-22 patch which was i386 only.
> I believe compiler generated code will never depend on pointer equality
> if it uses R_X86_64_PC32 or R_X86_64_PLT32 relocations.
> In hand written assembly one can certainly use:
> leaq foo(%rip), %rax
> or .long foo-.
> and then compare pointers, but there is no reason to do that
> (in -fno-pic code mov $foo, %eax is shorter, in -mcmodel=medium
> movabsq $foo, %rax is generated and in -fpic code, given that
> foo is known not to be in the same executable or shared library
> as the instruction, a GOTPCREL relocation is created instead).
> Ok to commit?

Is there somewhere (in the gas or ld manuals maybe?) this sort of
gotcha can be written down?  Otherwise the voodoo will be lost.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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