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 pointerequality not needed for x86-64


Daniel Jacobowitz <drow@false.org> writes:

> 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.

I agree with Daniel, we should document this somewhere.

Otherwise the patch is approved,

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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