public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: Jakub Jelinek <jakub@redhat.com>
Cc: binutils@sources.redhat.com
Subject: Re: [PATCH] Fix compute_bucket_count
Date: Mon, 03 Jul 2006 06:14:00 -0000	[thread overview]
Message-ID: <20060703061352.GP4388@bubble.grove.modra.org> (raw)
In-Reply-To: <20060623155502.GT3823@sunsite.mff.cuni.cz>

On Fri, Jun 23, 2006 at 05:55:02PM +0200, Jakub Jelinek wrote:
> I believe this hasn't been updated since (most of) 64-bit targets
> started using 4 byte .hash sh_entsize (as required by ELF).
> Certainly max = (2 + nsyms) * (bed->s->arch_size / 8);
> looks very much like an attempt to compute the size of the .hash
> section except the nbuckets part.  But
> 1) on most 64-bit targets .hash entsize is not 8

Of course using the "wrong" sizes just tweaks the weighting given to
short chains vs. overall table size.  Still, we may as well be using the
same algorithm for 64-bit vs. 32-bit.  Changing (bed->s->arch_size / 8)
to bed->s->sizeof_hash_entry is OK to commit.

> 2) the chains part of .hash section is really dynsymcount entries large
>    (corresponds 1:1 to .dymsym entries), while nsyms can be smaller number
>    (STT_SECTION symbols, symbol 0)
> On the other side, when not optimizing, compute_bucket_count was looking
> at dynsymcount, but in that case the interesting number really is the number
> of dynamic symbols that are entered into the .hash table.

I'm not so sure about this change, which affects both 32-bit and
64-bit.  If I've analysed the change correctly, it will tend to result
in smaller hash tables at the expense of possibly longer chains, in both
the optimising and non-optimising cases.  Do we really want that?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

  reply	other threads:[~2006-07-03  6:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-23 16:27 Jakub Jelinek
2006-07-03  6:14 ` Alan Modra [this message]
2006-07-03  8:42   ` Jakub Jelinek
2006-07-04  1:06     ` Alan Modra
2006-07-04 10:01       ` Jakub Jelinek
2006-07-04 10:33         ` Jakub Jelinek
2006-07-04 10:51           ` Jakub Jelinek
2006-07-05  0:19         ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060703061352.GP4388@bubble.grove.modra.org \
    --to=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).