This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [GOLD] PowerPC tls_get_addr_optimize
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 3 Aug 2017 22:33:16 -0700
- Subject: Re: [GOLD] PowerPC tls_get_addr_optimize
- Authentication-results: sourceware.org; auth=none
- References: <20170801151100.GB10753@bubble.grove.modra.org>
> 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