This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Only complain about no aranges if CU has low_pc set (Was: [patch] Add printing of .gdb_index section to readelf)


On Mon, 2011-04-18 at 11:44 -0600, Tom Tromey wrote:
> >>>>> "Mark" == Mark Wielaard <mjw@redhat.com> writes:
> 
> Mark> Note that libdw relies on .debug_aranges. For example dwarf_addrdie (),
> Mark> which returns the CU DIE containing a given address, just returns NULL
> Mark> if the aranges section isn't there.
> 
> Yeah.  What makes this bug theoretical is that, AFAIK, nobody has seen
> it happen in the wild.  In practice, a missing .debug_aranges entry
> means that the CU covers no addresses.

To make this explicit, lets make the dwarflint check more specific in
this case. Petr, does the following make sense?

For CUs with no associated code and a new enough gcc this will no longer
complain when no aranges section is found when the CU doesn't have
low_pc set.

Thanks,

Mark

commit 3f8d455103b378d96d2a99124c1c332e1e28d9bd
Author: Mark Wielaard <mjw@redhat.com>
Date:   Thu Apr 21 15:00:34 2011 +0200

    dwarflint: Only complain about no aranges if CU has low_pc set.

diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc
index e415fb1..337b12d 100644
--- a/dwarflint/check_debug_info.cc
+++ b/dwarflint/check_debug_info.cc
@@ -1261,7 +1261,7 @@ check_debug_info_refs::check_debug_info_refs (checkstack &stack,
          << "unresolved reference to .debug_line table "
          << pri::hex (it->stmt_list.addr) << '.' << std::endl;
 
-      if (_m_aranges != NULL && !it->has_arange)
+      if (_m_aranges != NULL && !it->has_arange && it->low_pc != (uint64_t)-1)
        wr_message (it->head->where,
                    mc_impact_3 | mc_acc_suboptimal | mc_aranges | mc_info)
          << "no aranges table is associated with this CU." << std::endl;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]