This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix PR 20995 for cris-linux (please have a look)
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: amodra at gmail dot com
- Cc: binutils at sourceware dot org
- Date: Fri, 27 Jan 2017 19:23:42 +0100
- Subject: Re: Fix PR 20995 for cris-linux (please have a look)
- Authentication-results: sourceware.org; auth=none
> Date: Fri, 27 Jan 2017 22:58:16 +1030
> From: Alan Modra <amodra@gmail.com>
Thanks for having a look.
> On Fri, Jan 27, 2017 at 01:54:11AM +0100, Hans-Peter Nilsson wrote:
> It looks fine, but please do a little more work on your target and
> convert over to using the hash table shortcuts everywhere possible.
A fair point. I see parts of the hash-table-shortcuts framework
is just month old (lots of conversions by you for almost all
other targets, in particular for .dynbss) but other parts, like
for .got, are from 2009.
> > @@ -3787,7 +3797,8 @@ elf_cris_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
> > }
> > }
> > else if (! CONST_STRNEQ (name, ".got")
> > - && strcmp (name, ".dynbss") != 0)
> > + && strcmp (name, ".dynbss") != 0
> > + && s != htab->root.sdynrelro)
>
> This example of code in elf_cris_size_dynamic_sections is why I didn't
> convert cris at the same time I did other targets. You're not using
> the shortcuts to .dynbss or .got and seem to be doing something weird
> in checking for ".got*". When I'm working on non-vital changes for
> lots of targets it doesn't take much oddity in the target for me to
> leave the fix to the target maintainer, assuming the target has a
> maintainer.
I had to look up what that was about. In all fairness, the
"weirdness" is copied over from the also unconverted
elf32-m68k.c (see top of elf32-cris.c) long before any
hash-table-shortcuts, and the quoted lines have since been
touched only by you and Nick. At least, so says git. Almost
identical to other targets, in particular the .got-weirdness.
Yes, it seems wrong to match (all) sections with ".got" as a
prefix, as opposed to specifically ".got" and ".got.plt". Maybe
a misguided attempt at future-proofness and/or slipping into
using the same pattern needed for ".rela"-sections (still, maybe
name-matching isn't needed there either).
brgds, H-P