This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold] PowerPC PLT
"David Edelsohn" <dje.gcc@gmail.com> writes:
> On Tue, Nov 18, 2008 at 10:49 AM, Ian Lance Taylor <iant@google.com> wrote:
>
>>> + // Define blrl instruction at _G_O_T_ - 4 for old ABI.
>>> + this->got_->add_constant(blrl);
>>> // Define _GLOBAL_OFFSET_TABLE_ at the start of the .got section.
>>> + Symbol *got_anchor =
>>> symtab->define_in_output_data("_GLOBAL_OFFSET_TABLE_", NULL,
>>> ! this->got_plt_,
>>> 0, 0, elfcpp::STT_OBJECT,
>>> elfcpp::STB_LOCAL,
>>> elfcpp::STV_HIDDEN, 0,
>>> false, false);
>>> + // ???
>>> + got_anchor->set_got_offset (GOT_TYPE_STANDARD, 1);
>>
>> Calling set_got_offset here may be correct but it seems odd. Normally
>> the linker calls set_got_offset for a symbol which is referenced by a
>> relocation type which requires a GOT entry. _GLOBAL_OFFSET_TABLE_
>> points to the GOT but it does not itself have a GOT entry.
>
> Thanks for the explanations and feedback. My intent was to set the
> beginning of the GOT at _G_O_T_, allowing for the blrl instruction
> immediately before it. I think it is better and simpler not to try to support
> the old PPC32 ABI in gold.
Defining _GLOBAL_OFFSET_TABLE_ is sensible and appropriate. Calling
set_got_offset on that symbol seems unnecessary.
Ian