This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gold: remove unused methods in Output_data_got_powerpc

On Fri, Oct 11, 2013 at 4:14 PM, Alan Modra <> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]