Commit 6ac00218 by Mark Wielaard Committed by Mark Wielaard

PR42288 emit empty .debug_aranges section.

* dwarf2out.c (dwarf2out_finish): Always call output_aranges ()
  when info_section_emitted.

From-SVN: r173340
parent 3af42a7b
2011-04-26 Mark Wielaard <mjw@redhat.com>
PR42288
* dwarf2out.c (dwarf2out_finish): Always call output_aranges ()
when info_section_emitted.
2011-05-03 Joseph Myers <joseph@codesourcery.com> 2011-05-03 Joseph Myers <joseph@codesourcery.com>
* config/mips/mips-opts.h: New. * config/mips/mips-opts.h: New.
......
...@@ -24587,21 +24587,17 @@ dwarf2out_finish (const char *filename) ...@@ -24587,21 +24587,17 @@ dwarf2out_finish (const char *filename)
} }
} }
/* Output the address range information. We only put functions in the /* Output the address range information if a CU (.debug_info section)
arange table, so don't write it out if we don't have any. */ 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) if (info_section_emitted)
{ {
unsigned long aranges_length = size_of_aranges (); unsigned long aranges_length = size_of_aranges ();
/* Empty .debug_aranges would contain just header and switch_to_section (debug_aranges_section);
terminating 0,0. */ output_aranges (aranges_length);
if (aranges_length
!= (unsigned long) (DWARF_ARANGES_HEADER_SIZE
+ 2 * DWARF2_ADDR_SIZE))
{
switch_to_section (debug_aranges_section);
output_aranges (aranges_length);
}
} }
/* Output ranges section if necessary. */ /* Output ranges section if necessary. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment