This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gcc/gdb/as/ld issue
- From: Nick Clifton <nickc at redhat dot com>
- To: Andy Chittenden <achittenden at bluearc dot com>
- Cc: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>
- Date: Wed, 31 Mar 2004 10:26:20 +0100
- Subject: Re: gcc/gdb/as/ld issue
- References: <AD4480A509455343AEFACCC231BA850F015405CF@ukexchange>
Hi Andy,
> I've found the cause of the issue in bfd/stabs.c in that it throws
> away too many BINCL sections. It turns out that the psuedo hash used
> to detect duplicates is detecting bogus duplicates. This patch
> demonstrated the problem by also saving the length of the symbols
> along with the hash and printing out a message when it would have
> dropped a "duplicate" previously. Unfortunately, I don't think this
> is the full fix as the length of the symbols may be identical as
> well even though the symbols may be different. Anyway, gdb is now
> happy in our environment with this fix (for now). Please can someone
> come up with a proper fix?
There is no perfect way to identify duplicates apart from caching
the entire B_INCL...B_EINCL range and then performing a bytewise
comparison against future ranges. Something that would take up far
too much time and resources.
Using an MD5 type algorithm would probably be the best solution, but
until somebody wants to code that I am going to apply your length
caching patch instead. I made two small changes to your patch:
1. I renamed the field 'total' to 'sum_chars' and the field 'len' to
'num_chars'. I think that this makes the code more readable.
2. I removed the addition of a 'len' field to stab_excl_list
structure. It was never used.
Oh and:
3. I added a comment about using MD5 some day.
4. I created a ChangeLog entry:
bfd/ChangeLog
2004-03-31 Andy Chittenden <achittenden@bluearc.com>
* stabs.c (struct stab_link_includes_totals): Rename field 'total'
to 'sum_chars' and add field 'num_chars'.
(_bfd_link_section_stabs): When computing the sum of the
characters in a B_INCL..B_EINCL range also keep a count of the
number of characters. Use this information to help distinguish
between include sections when have the same sum but which
nevertheless are still unique.
Cheers
Nick