This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/1] gold: Avoid duplicate PLT stub symbols on PowerPC
On Sun, Jun 18, 2017 at 10:58:03PM +0100, James Clarke wrote:
> If two objects are compiled with -fPIC or -fPIE and call the same
> function, two different PLT entries are created, one for each object,
I'd be surprised if that was so when using your simple testcase, and
testing here verifies it. There is a situation where this can occur:
In a very large binary it may be necessary to create multiple stubs to
call a given function, because calls are so far apart that a single
stub cannot be reached by a "bl" instruction. However, that case
ought to be covered by this->uniq_ being different for each
stub_table. So I'm not sure how you are getting the failure.
> but the same stub symbol name is used for both. Therefore let's make
> the names unique by incorporating the object's uniq_ value where
> necessary.
>
> gold/
> * (Stub_table::define_stub_syms): Include object's uniq_ value
> when set for non-local symbols as well.
This won't work. object_ isn't set for ppc64 globals. See the
Plt_stub_ent constructors.
--
Alan Modra
Australia Development Lab, IBM