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: sparc TPOFF handling in GOLD


David Miller <davem@davemloft.net> writes:

> From: David Miller <davem@davemloft.net>
> Date: Wed, 10 Feb 2010 13:00:28 -0800 (PST)
>
>> From: Ian Lance Taylor <iant@google.com>
>> Date: Wed, 10 Feb 2010 12:54:00 -0800
>> 
>>> I haven't yet looked into how x86_64 works, but it seems to me that
>>> the problem kind of boils down the fact that there is no way to
>>> control the addend when using add_local_with_rela.  Does that sound
>>> right to you?
>> 
>> Yep, that sounds about right.
>
> Actually, I stand corrected.  It's the lack of ability to control the
> addend _and_ the symbol index.
>
> For local symbol IE relocations we definitely want the TPOFF{32,64} to
> be output with a zero symbol index and relative addend calculations.
>
> As we've been discussing, there is currently no easy way to do this
> from a GOLD target.

That sounds basically right to me.  Probably we should split
is_relative_ into two fields: one which says that the reloc should use
a symbol index of 0 and the symbol value as the addend, and one which
says that the reloc should be sorted and counted as a RELATIVE reloc.
Then most of the Output_reloc constructors get a new parameter.  Hmmm.

Then I guess that rather than using the
Output_data_got::add_local_with_rela helper function, that code will
have to be done manually in sparc.cc.  That is, assign the GOT offset
and create the reloc, as in, e.g., x86_64.cc handling of
R_X86_64_GOTPC32_TLSDESC for a local symbol.

Ian


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