GOLD handling of weak symbols (including x86 vs. ARM)

Richard Sandiford richard.sandiford@linaro.org
Wed Nov 3 17:11:00 GMT 2010


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



More information about the Binutils mailing list