aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2011-05-03 19:36:08 +0000
committerMark Wielaard <mark@gcc.gnu.org>2011-05-03 19:36:08 +0000
commit6ac00218e10463af6597fb22e942601fd3751fad (patch)
treec21d71f9c1619f6fa81526e26f8effb83e9e44c5 /gcc
parent3af42a7bacf04933a6ce32a9b04ea4217f1cc392 (diff)
downloadgcc-6ac00218e10463af6597fb22e942601fd3751fad.zip
gcc-6ac00218e10463af6597fb22e942601fd3751fad.tar.gz
gcc-6ac00218e10463af6597fb22e942601fd3751fad.tar.bz2
PR42288 emit empty .debug_aranges section.
* dwarf2out.c (dwarf2out_finish): Always call output_aranges () when info_section_emitted. From-SVN: r173340
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c18
2 files changed, 13 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 37c251a..78b593f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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>
* config/mips/mips-opts.h: New.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 83653d2..f3620a4 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -24587,21 +24587,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. */