Hi!

Mark has recently changed dwarf2out to not emit anything into .debug_abbrev
section if there are no abbreviations, but as Rainer has reported, some
vendor tools are upset about it.  We were still emitting the .debug_abbrev
section, just with zero size, in order to emit the .Ldebug_abbrev0
symbol into it (which isn't used anywhere though).  So, I wonder if we
can fix that by not adding .section .debug_abbrev and emitting
the label in that case at all.  Rainer, does this make SGI tools
happy?

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2011-06-29  Jakub Jelinek  <ja...@redhat.com>

        PR debug/49364
        * dwarf2out.c (output_abbrev_section): Don't return early
        if abbrev_die_table_in_use is 1.
        (dwarf2out_finish): Instead don't call output_abbrev_section
        nor emit abbrev_section_label in that case.

--- gcc/dwarf2out.c.jj  2011-06-28 16:12:08.000000000 +0200
+++ gcc/dwarf2out.c     2011-06-29 19:25:12.000000000 +0200
@@ -11358,9 +11358,6 @@ output_abbrev_section (void)
 {
   unsigned long abbrev_id;
 
-  if (abbrev_die_table_in_use == 1)
-    return;
-
   for (abbrev_id = 1; abbrev_id < abbrev_die_table_in_use; ++abbrev_id)
     {
       dw_die_ref abbrev = abbrev_die_table[abbrev_id];
@@ -25226,9 +25223,12 @@ dwarf2out_finish (const char *filename)
   output_comp_unit (comp_unit_die (), debug_info_level >= DINFO_LEVEL_VERBOSE);
 
   /* Output the abbreviation table.  */
-  switch_to_section (debug_abbrev_section);
-  ASM_OUTPUT_LABEL (asm_out_file, abbrev_section_label);
-  output_abbrev_section ();
+  if (abbrev_die_table_in_use != 1)
+    {
+      switch_to_section (debug_abbrev_section);
+      ASM_OUTPUT_LABEL (asm_out_file, abbrev_section_label);
+      output_abbrev_section ();
+    }
 
   /* Output location list section if necessary.  */
   if (have_location_lists)

        Jakub

Reply via email to