On Tue, 2011-04-26 at 11:10 +0200, Mark Wielaard wrote: > This PR was put on hold for a while since gdb didn't immediately need > it. But the consensus seemed that it was a good idea to always output > the address ranges (.debug_arange section) information if a CU > (.debug_info section) was emitted. Because the consumer has no way to > tell the difference between an empty table that we omitted and failure > to generate a table that would have contained data. We recently > discussed this again (see PR), and it still seems like a good thing. So > here it a patch to just do that: > > 2011-04-26 Mark Wielaard <m...@redhat.com> > > PR42288 > * dwarf2out.c (dwarf2out_finish): Always call output_aranges () > when info_section_emitted. > > Tested on i686-pc-linux-gnu, no changes in test results.
Ping. Thanks, Mark
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index f3c4c09..520d7a2 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -23812,21 +23812,17 @@ dwarf2out_finish (const char *filename) } } - /* Output the address range information. We only put functions in the - arange table, so don't write it out if we don't have any. */ + /* Output the address range information if a CU (.debug_info section) + was emitted. We output an empty table even if we had no functions + to put in it. This because the consumer has no way to tell the + difference between an empty table that we omitted and failure to + generate a table that would have contained data. */ if (info_section_emitted) { unsigned long aranges_length = size_of_aranges (); - /* Empty .debug_aranges would contain just header and - terminating 0,0. */ - if (aranges_length - != (unsigned long) (DWARF_ARANGES_HEADER_SIZE - + 2 * DWARF2_ADDR_SIZE)) - { - switch_to_section (debug_aranges_section); - output_aranges (aranges_length); - } + switch_to_section (debug_aranges_section); + output_aranges (aranges_length); } /* Output ranges section if necessary. */