[PATCH, committed]: Don't call dwarf2out_note_section_used if cold_text_section is NULL.

Uros Bizjak ubizjak@gmail.com
Sat Jan 19 22:42:00 GMT 2008


Hello!

*_used variables are needed only when debugging, to construct 
.debug_aranges section. This patch adds the condition when to call 
dwarf2out_section_used.

Patch was bootstrapped and regression tested on x86_64-linux-gnu 
{,-m32}. Patch was committed to SVN as obvious.

2008-01-19  Uros Bizjak  <ubizjak@gmail.com>

        * dwarf2out.c (dwarf2out_switch_text_section): Do not call
        dwarf2out_note_section_used if cold_text_section is NULL.

Uros.

Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 131650)
+++ dwarf2out.c (working copy)
@@ -2729,7 +2729,9 @@ dwarf2out_switch_text_section (void)
      don't attempt to advance_loc4 between labels in different 
sections.  */
   fde->dw_fde_current_label = NULL;
 
-  dwarf2out_note_section_used ();
+  /* There is no need to mark used sections when not debugging.  */
+  if (cold_text_section != NULL)
+    dwarf2out_note_section_used ();
 }
 #endif




More information about the Gcc-patches mailing list