diff options
author | Tom Tromey <tom@tromey.com> | 2023-12-04 07:48:42 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-12-04 11:20:44 -0700 |
commit | e0a874120a21bd460bd922c337f4869f72751dcf (patch) | |
tree | 610559b69347e27e6c0cb5dd73fe3777c48aaf3e /binutils/ChangeLog | |
parent | 9c2370293ebe8354cca0d9dfa745f3bebf238d6d (diff) | |
download | binutils-e0a874120a21bd460bd922c337f4869f72751dcf.zip binutils-e0a874120a21bd460bd922c337f4869f72751dcf.tar.gz binutils-e0a874120a21bd460bd922c337f4869f72751dcf.tar.bz2 |
Fix two buglets in .debug_names dumping
While working on gdb's .debug_names writer, I found a couple of small
bugs in binutils .debug_names dumping.
First, the DWARF spec (section 6.1.1.4.6 Name Table) says:
These two arrays are indexed starting at 1, [...]
I think it is clearer for binutils to follow this, particularly
because DW_IDX_parent refers to this number.
Second, I think the handling of an empty hash table is slightly wrong.
Currently the dumping code assumes there is always an array of hashes.
However, section 6.1.1.4.5 Hash Lookup Table says:
The optional hash lookup table immediately follows the list of
type signatures.
and then:
The hash lookup table is actually two separate arrays: an array of
buckets, followed immediately by an array of hashes.
My reading of this is that the hash table as a whole is optional, and
so the hashes will not exist in this case. (This also makes sense
because the hashes are not useful without the buckets anyway.)
This patch fixes both of these problems. FWIW I have some gdb patches
in progress that change gdb both to omit the hash table and to use
DW_IDX_parent.
2023-12-04 Tom Tromey <tom@tromey.com>
* dwarf.c (display_debug_names): Handle empty .debug_names hash
table. Name entries start at 1.
Diffstat (limited to 'binutils/ChangeLog')
-rw-r--r-- | binutils/ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index b53a9e9..cfe081a 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2023-12-04 Tom Tromey <tom@tromey.com> + + * dwarf.c (display_debug_names): Handle empty .debug_names hash + table. Name entries start at 1. + 2023-11-15 Arsen Arsenović <arsen@aarsen.me> * aclocal.m4: Regenerate. |