]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: .debug_info check was always failing
authorPetr Machata <pmachata@redhat.com>
Mon, 30 Nov 2009 12:34:48 +0000 (13:34 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 18 Aug 2010 12:55:14 +0000 (14:55 +0200)
* Also drop the cu_chain reversal.  In vector, CUs are stored naturally
  already.  Reversal for performance gains has actually opposite result.

src/dwarflint/check_debug_info.cc

index fae697984ade9cca9b87f086042458efbf08fe78..bab45b5aa1e9c80bad32e265d57d71f9c1df226e 100644 (file)
@@ -1015,7 +1015,7 @@ read_cu_headers::read_cu_headers (dwarflint &lint)
 {
 }
 
-struct cu *
+void
 check_debug_info::check_info_structural (struct elf_file *file,
                                         Elf_Data *strings)
 {
@@ -1024,7 +1024,6 @@ check_debug_info::check_info_structural (struct elf_file *file,
   struct ref_record die_refs;
   WIPE (die_refs);
 
-  struct cu *cu_chain = NULL;
   bool success = true;
 
   struct coverage strings_coverage_mem, *strings_coverage = NULL;
@@ -1146,21 +1145,6 @@ check_debug_info::check_info_structural (struct elf_file *file,
        }
       coverage_free (strings_coverage);
     }
-
-  /* Reverse the chain, so that it's organized "naturally".  Has
-     significant impact on performance when handling loc_ref and
-     range_ref fields in loc/range validation.  */
-  struct cu *last = NULL;
-  for (struct cu *it = cu_chain; it != NULL; )
-    {
-      struct cu *next = it->next;
-      it->next = last;
-      last = it;
-      it = next;
-    }
-  cu_chain = last;
-
-  return cu_chain;
 }
 
 check_debug_info::check_debug_info (dwarflint &lint)
@@ -1171,14 +1155,7 @@ check_debug_info::check_debug_info (dwarflint &lint)
   , _m_cu_headers (lint.check (_m_cu_headers))
 {
   memset (&cu_cov, 0, sizeof (cu_cov));
-
-  cu *chain = check_info_structural (&_m_sec_info->file, _m_sec_str->sect.data);
-
-  if (chain == NULL)
-    throw check_base::failed ();
-
-  for (cu *cu = chain; cu != NULL; cu = cu->next)
-    cus.push_back (*cu);
+  check_info_structural (&_m_sec_info->file, _m_sec_str->sect.data);
 
   // re-link CUs so that they form a chain again.  This is to
   // interface with C-level code.  The last CU's next is NULL, so we