From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61558 invoked by alias); 7 Jan 2017 20:01:01 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 60734 invoked by uid 9674); 7 Jan 2017 20:01:00 -0000 Date: Sat, 07 Jan 2017 20:01:00 -0000 Message-ID: <20170107200100.60621.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] users/jkratoch/dwarf5readelf-indexcxx-debugnames: . X-Git-Refname: refs/heads/users/jkratoch/dwarf5readelf-indexcxx-debugnames X-Git-Reftype: branch X-Git-Oldrev: 8ca64c9f87567007af4a5714b0b7b78613e5fcfa X-Git-Newrev: ec55f88e5cd29bb9555047ed5986dfb88635cb4a X-SW-Source: 2017-q1/txt/msg00014.txt.bz2 List-Id: The branch, users/jkratoch/dwarf5readelf-indexcxx-debugnames has been updated via ec55f88e5cd29bb9555047ed5986dfb88635cb4a (commit) from 8ca64c9f87567007af4a5714b0b7b78613e5fcfa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit ec55f88e5cd29bb9555047ed5986dfb88635cb4a Author: Jan Kratochvil Date: Sat Jan 7 20:59:47 2017 +0100 . ----------------------------------------------------------------------- Summary of changes: binutils/dwarf.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 37 insertions(+), 2 deletions(-) First 500 lines of diff: diff --git a/binutils/dwarf.c b/binutils/dwarf.c index d87f39d..75af30d 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -6900,9 +6900,9 @@ display_debug_names (struct dwarf_section *section, void *file) putchar ('\n'); } - // const uint32_t *const hash_table_buckets = (uint32_t *) hdrptr; + const uint32_t *const hash_table_buckets = (uint32_t *) hdrptr; hdrptr += bucket_count * sizeof (uint32_t); - // const uint32_t *const hash_table_hashes = (uint32_t *) hdrptr; + const uint32_t *const hash_table_hashes = (uint32_t *) hdrptr; hdrptr += name_count * sizeof (uint32_t); const void *const name_table_string_offsets = hdrptr; hdrptr += name_count * offset_size; @@ -6921,6 +6921,41 @@ display_debug_names (struct dwarf_section *section, void *file) return 0; } + size_t buckets_filled = 0; + size_t bucketi; + for (bucketi = 0; bucketi < bucket_count; bucketi++) + { + const uint32_t bucket = hash_table_buckets[bucketi]; + + if (bucket != 0) + ++buckets_filled; + } + printf (_("Filled %zu of %lu buckets.\n"), buckets_filled, + (unsigned long) bucket_count); + + uint32_t hash_prev; + size_t clash_count = 0; + size_t longest_clash = 0; + size_t this_length; + size_t hashi; + for (hashi = 0; hashi < name_count; hashi++) + { + const uint32_t hash_this = hash_table_hashes[hashi]; + + if (hashi > 0 && hash_prev == hash_this) + { + ++clash_count; + ++this_length; + longest_clash = MAX (longest_clash, this_length); + } + else + this_length = 0; + hash_prev = hash_this; + } + printf (_("Out of %lu names there are %zu clashes " + "(longest of %zu entries).\n"), + (unsigned long) name_count, clash_count, longest_clash); + struct abbrev_lookup_entry { dwarf_vma abbrev_tag; hooks/post-receive -- Repository for Project Archer.