--- ./gdb/xcoffread.c_orig	2011-12-01 16:25:05.418467435 +0530
+++ ./gdb/xcoffread.c	2012-03-14 16:22:37.761967467 +0530
@@ -1123,43 +1123,44 @@
 		         approach does not work!  GCC (and I think xlc) seem
 		         to put all the code in the unnamed program csect.  */
 
-		      if (last_csect_name)
-			{
-			  complete_symtab (filestring, file_start_addr);
-			  cur_src_end_addr = file_end_addr;
-			  end_symtab (file_end_addr, objfile,
-				      SECT_OFF_TEXT (objfile));
-			  end_stabs ();
-			  start_stabs ();
-			  /* Give all csects for this source file the same
-			     name.  */
-			  start_symtab (filestring, NULL, (CORE_ADDR) 0);
-			  record_debugformat (debugfmt);
-			}
-
-		      /* If this is the very first csect seen,
-		         basically `__start'.  */
-		      if (just_started)
-			{
-			  first_object_file_end
-			    = cs->c_value + CSECT_LEN (&main_aux);
-			  just_started = 0;
-			}
-
-		      file_start_addr =
-			cs->c_value + ANOFFSET (objfile->section_offsets,
-						SECT_OFF_TEXT (objfile));
-		      file_end_addr = file_start_addr + CSECT_LEN (&main_aux);
-
-		      if (cs->c_name && (cs->c_name[0] == '.'
-					 || cs->c_name[0] == '@'))
-			{
-			  last_csect_name = cs->c_name;
-			  last_csect_val = cs->c_value;
-			  last_csect_sec = secnum_to_section (cs->c_secnum,
-							      objfile);
-			}
-		    }
+                       if (just_started)
+                       {
+                          first_object_file_end
+                            = cs->c_value + CSECT_LEN (&main_aux);
+                          just_started = 0; 
+                       }
+
+                       file_start_addr =
+                         cs->c_value + ANOFFSET (objfile->section_offsets,
+                                               SECT_OFF_TEXT (objfile));
+                       file_end_addr = file_start_addr + CSECT_LEN (&main_aux);
+
+                       if (cs->c_name && (cs->c_name[0] == '.'
+                                         || cs->c_name[0] == '@'))
+                       {
+                          last_csect_name = cs->c_name;
+                          last_csect_val = cs->c_value;
+                          last_csect_sec = secnum_to_section (cs->c_secnum,
+                                                              objfile);
+                       }
+                       if (last_csect_name)
+                       {    
+                          filestring = pst->filename;
+                          complete_symtab (filestring, file_start_addr);
+                          cur_src_end_addr = file_end_addr;
+                          end_symtab (file_end_addr, objfile,
+                                      SECT_OFF_TEXT (objfile));
+                          end_stabs ();
+                          start_stabs ();
+                          /* Give all csects for this source file the same
+                             name.  */
+                          start_symtab (filestring, (char *)NULL, (CORE_ADDR) 0);
+                          record_debugformat (debugfmt);
+                       }    
+                      /* If this is the very first csect seen,
+                         basically `__start'.  */
+                    }
+
 		    continue;
 
 		    /* All other symbols are put into the minimal symbol
