2011-05-26 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / elfread.c
index f691b8f92ccc724671200524f94177cd1075bdcc..825df0f1da67b962002cdc7cbfcd0b0632162d1d 100644 (file)
@@ -257,7 +257,6 @@ elf_symtab_read (struct objfile *objfile, int type,
   char *filesymname = "";
   struct dbx_symfile_info *dbx = objfile->deprecated_sym_stab_info;
   int stripped = (bfd_get_symcount (objfile->obfd) == 0);
-  struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
 
   for (i = 0; i < number_of_symbols; i++)
     {
@@ -486,7 +485,6 @@ elf_symtab_read (struct objfile *objfile, int type,
                                  + (sizeof (CORE_ADDR) * max_index));
                          sectinfo = (struct stab_section_info *)
                            xmalloc (size);
-                         make_cleanup (xfree, sectinfo);
                          memset (sectinfo, 0, size);
                          sectinfo->num_sections = max_index;
                          if (filesym == NULL)
@@ -595,7 +593,6 @@ elf_symtab_read (struct objfile *objfile, int type,
            }
        }
     }
-  do_cleanups (back_to);
 }
 
 /* Build minimal symbols named `function@got.plt' (see SYMBOL_GOT_PLT_SUFFIX)
@@ -1394,9 +1391,14 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
                                bfd_section_size (abfd, str_sect));
     }
 
-  if (dwarf2_has_info (objfile))
+  if (dwarf2_has_info (objfile, NULL))
     {
-      if (dwarf2_initialize_objfile (objfile))
+      /* elf_sym_fns_gdb_index cannot handle simultaneous non-DWARF debug
+        information present in OBJFILE.  If there is such debug info present
+        never use .gdb_index.  */
+
+      if (!objfile_has_partial_symbols (objfile)
+         && dwarf2_initialize_objfile (objfile))
        objfile->sf = &elf_sym_fns_gdb_index;
       else
        {
@@ -1435,7 +1437,7 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
 static void
 read_psyms (struct objfile *objfile)
 {
-  if (dwarf2_has_info (objfile))
+  if (dwarf2_has_info (objfile, NULL))
     dwarf2_build_psymtabs (objfile);
 }
 
This page took 0.024149 seconds and 4 git commands to generate.