This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Clearing st_value of PLT SHN_UNDEF symbols if pointer equality not needed for x86-64
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com, jh at suse dot cz
- Date: Thu, 22 Apr 2004 11:51:42 -0400
- Subject: Re: [PATCH] Clearing st_value of PLT SHN_UNDEF symbols if pointer equality not needed for x86-64
- References: <20040422133116.GH5191@sunsite.ms.mff.cuni.cz>
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