This is the mail archive of the binutils@sourceware.org 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: [GOLD] PowerPC tls_get_addr_optimize


> I decided to not
> template clone because treating its arguments as Sized_symbol isn't
> correct given that mips derives its own symbol class.  Passing in a
> size at least gives a nod towards supporting clone on derived
> classes.

Cloning with memcpy would preclude us from ever putting a member in
the symbol class that has a custom assignment operator, right? (Not
that I ever would want to do that -- Symbol is supposed to be
lightweight -- but I still don't want to build in gotchas like that.)

I'd prefer to template it and use a real assignment rather than
passing in the size and using memcpy. Since it's only called from the
target code, the caller will know what symbol type to pass in as the
template parameter, and if a target with its own symbol class needs to
use it, it can provide a clone() override in its derived class.

I'm prepared to reconsider if you still disagree.

-cary


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