if (dwarf2_has_info (abfd))
if (dwarf2_has_info (objfile))
elf_symfile_read (struct objfile *objfile, int mainline){  bfd *abfd = objfile->obfd;  struct elfinfo ei;  struct cleanup *back_to;  CORE_ADDR offset;  init_minimal_symbol_collection ();  back_to = make_cleanup_discard_minimal_symbols ();  memset ((char *) &ei, 0, sizeof (ei));  /* Allocate struct to keep track of the symfile */  objfile->sym_stab_info = (struct dbx_symfile_info *)    xmmalloc (objfile->md, sizeof (struct dbx_symfile_info));  memset ((char *) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));  make_cleanup (free_elfinfo, (void *) objfile);  /* Process the normal ELF symbol table first.  This may write some      chain of info into the dbx_symfile_info in objfile->sym_stab_info,     which can later be used by elfstab_offset_sections.  */  elf_symtab_read (objfile, 0);  /* Add the dynamic symbols.  */  elf_symtab_read (objfile, 1);  /* Install any minimal symbols that have been collected as the current     minimal symbols for this objfile.  The debug readers below this point     should not generate new minimal symbols; if they do it's their     responsibility to install them.  "mdebug" appears to be the only one     which will do this.  */  install_minimal_symbols (objfile);  do_cleanups (back_to);  /* Now process debugging information, which is contained in     special ELF sections. */  /* If we are reinitializing, or if we have never loaded syms yet,     set table to empty.  MAINLINE is cleared so that *_read_psymtab     functions do not all also re-initialize the psymbol table. */  if (mainline)    {      init_psymbol_list (objfile, 0);      mainline = 0;    }  /* We first have to find them... */  bfd_map_over_sections (abfd, elf_locate_sections, (void *) & ei);  /* ELF debugging information is inserted into the psymtab in the     order of least informative first - most informative last.  Since     the psymtab table is searched `most recent insertion first' this     increases the probability that more detailed debug information     for a section is found.     For instance, an object file might contain both .mdebug (XCOFF)     and .debug_info (DWARF2) sections then .mdebug is inserted first     (searched last) and DWARF2 is inserted last (searched first).  If     we don't do this then the XCOFF info is found first - for code in     an included file XCOFF info is useless. */  if (ei.mdebugsect)    {      const struct ecoff_debug_swap *swap;      /* .mdebug section, presumably holding ECOFF debugging         information.  */      swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;      if (swap)	elfmdebug_build_psymtabs (objfile, swap, ei.mdebugsect);    }  if (ei.stabsect)    {      asection *str_sect;      /* Stab sections have an associated string table that looks like         a separate section.  */      str_sect = bfd_get_section_by_name (abfd, ".stabstr");      /* FIXME should probably warn about a stab section without a stabstr.  */      if (str_sect)	elfstab_build_psymtabs (objfile,				mainline,				ei.stabsect,				str_sect->filepos,				bfd_section_size (abfd, str_sect));    }  if (dwarf2_has_info (abfd))    {      /* DWARF 2 sections */      dwarf2_build_psymtabs (objfile, mainline);    }  else if (ei.dboffset && ei.lnoffset)    {      /* DWARF sections */      dwarf_build_psymtabs (objfile,			    mainline,			    ei.dboffset, ei.dbsize,			    ei.lnoffset, ei.lnsize);    }  /* FIXME: kettenis/20030504: This still needs to be integrated with     dwarf2read.c in a better way.  */  dwarf2_build_frame_info (objfile);}