This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [GOLD] Symbol target_flag for PowerPC64 localentry:0 tracking
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 31 Jul 2017 11:21:55 -0700
- Subject: Re: [GOLD] Symbol target_flag for PowerPC64 localentry:0 tracking
- Authentication-results: sourceware.org; auth=none
- References: <20170731101540.GH1956@bubble.grove.modra.org>
> This patch provides a flag for target use in class Symbol, and
> modifies Sized_target::resolve to return whether the symbol has been
> resolved. If not, normal processing continues. I use this for
> PowerPC64 ELFv2 to keep track of whether a symbol has any definition
> with non-zero localentry, in order to disable --plt-localentry for
> that symbol.
>
> I know the right way to add target specific symbol fields is via a
> derived class and Sized_target::make_symbol, which would be easy to do
> for powerpc, but there are lots of holes in Symbol available. So I
> thought I'd test the reaction to this patch before wasting another
> word per symbol.
>
> OK?
I think I'd prefer it if we pretended that your new flag was not, in
fact, target specific -- i.e., just name it something like
has_localentry. You'd still need the target-specific resolve(), due to
the way you have to check for the condition, but I can imagine another
target maybe wanting that flag someday. As you say, it's a lot cheaper
than deriving a new class.
(Ian was pretty prescient when he provided that target-specific
resolve hook, heretofore never used! I've considered removing it on
more than one occasion. (It's possible it was once used then removed,
but I haven't done the archaeology to find out.))
-cary