[PATCH] gold: remove unused methods in Output_data_got_powerpc

Roland McGrath mcgrathr@google.com
Fri Oct 11 23:22:00 GMT 2013


On Fri, Oct 11, 2013 at 4:14 PM, Alan Modra <amodra@gmail.com> wrote:
> No, wait a minute.  I do want those functions, but probably
> misunderstood C++ rules so they aren't effective.  I need to somehow
> arrange that Output_data_got_powerpc::reserve_ent() is called before
> Output_data_got adds anything to its entries_ vector, because the
> powerpc got header can sit somewhere in the middle of the GOT.  What's
> the best way to accomplish that?

You need to change those in Output_data_got (the base class) to be virtual.
Then you can override them in Output_data_got_powerpc and use
Output_data_got<size, big_endian>::add_got_entry to call the superclass
method after doing what you need to do first.  Also note that you need to
name the argument type as Output_data_got<size, big_endian>::Got_entry.
You'll probably want to do typedef Output_data_got<size, big_endian> Base;
or suchlike in Output_data_got_powerpc so you can reduce the amount of
typing on the lhs of each :: there.

And, of course, add a test case that notices the failure mode of missing
the reserve_ent call so you can tell whether you got it right.


Thanks,
Roland



More information about the Binutils mailing list