This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: GOLD handling of weak symbols (including x86 vs. ARM)
Ian Lance Taylor <iant@google.com> writes:
> However, over in needs_dynamic_reloc, I see this:
>
> // A reference to an undefined symbol from an executable should be
> // statically resolved to 0, and does not need a dynamic relocation.
> // This matches gnu ld behavior.
> if (this->is_undefined() && !parameters->options().shared())
> return false;
Yeah.
> So I think we've already decided that we are screwed in this case.
>
> And that means that we should remove these lines from use_plt_offset:
> if (this->is_weak_undefined())
> return true;
> since we've decided that such symbols should be statically resolved to
> 0.
Yeah, TBH, that's the code I was hoping to remove, but was nervous
because it was obviously added deliberately.
> That seems weird to me but perhaps it makes sense in some universe.
:-) OK, thanks, I'll test that and submit.
Richard