+ storage_needed = bfd_get_dynamic_symtab_upper_bound (objfile->obfd);
+
+ if (storage_needed > 0)
+ {
+ dyn_symbol_table = (asymbol **) xmalloc (storage_needed);
+ make_cleanup (xfree, dyn_symbol_table);
+ dynsymcount = bfd_canonicalize_dynamic_symtab (objfile->obfd,
+ dyn_symbol_table);
+
+ if (dynsymcount < 0)
+ error (_("Can't read symbols from %s: %s"), bfd_get_filename (objfile->obfd),
+ bfd_errmsg (bfd_get_error ()));
+
+ elf_symtab_read (objfile, 1, dynsymcount, dyn_symbol_table);
+ }
+
+ /* Add synthetic symbols - for instance, names for any PLT entries. */
+
+ synthcount = bfd_get_synthetic_symtab (abfd, symcount, symbol_table,
+ dynsymcount, dyn_symbol_table,
+ &synthsyms);
+ if (synthcount > 0)
+ {
+ asymbol **synth_symbol_table;
+ long i;
+
+ make_cleanup (xfree, synthsyms);
+ synth_symbol_table = xmalloc (sizeof (asymbol *) * synthcount);
+ for (i = 0; i < synthcount; i++)
+ synth_symbol_table[i] = synthsyms + i;
+ make_cleanup (xfree, synth_symbol_table);
+ elf_symtab_read (objfile, 0, synthcount, synth_symbol_table);
+ }
+
+ /* 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);