outputting_stabs_line_debug.
+2007-04-02  Sterling Augustine  <sterling@tensilica.com>
+
+       * config/tc-xtensa.c (xtensa_flush_pending_output): Check
+       outputting_stabs_line_debug.
+
 2007-03-26  Anatoly Sokolov <aesok@post.ru>
 
        * config/tc-avr.c (mcu_types): Add support for at90pwm1, at90usb82,
 
 void
 xtensa_flush_pending_output (void)
 {
+  /* This line fixes a bug where automatically generated gstabs info
+     separates a function label from its entry instruction, ending up
+     with the literal position between the function label and the entry
+     instruction and crashing code.  It only happens with --gstabs and
+     --text-section-literals, and when several other obscure relaxation
+     conditions are met.  */
+  if (outputting_stabs_line_debug)
+    return;
+
   if (cur_vinsn.inside_bundle)
     as_bad (_("missing closing brace"));