This commit was manufactured by cvs2svn to create tag
[external/binutils.git] / gdb / solib-sunos.c
index b5d9586..25682e0 100644 (file)
@@ -39,6 +39,8 @@
 #include "gdbcore.h"
 #include "inferior.h"
 #include "solist.h"
+#include "bcache.h"
+#include "regcache.h"
 
 /* Link map info to include in an allocated so_list entry */
 
@@ -135,8 +137,8 @@ allocate_rt_common_objfile (void)
   objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
   memset (objfile, 0, sizeof (struct objfile));
   objfile->md = NULL;
-  obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
-                             xmalloc, xfree);
+  objfile->psymbol_cache = bcache_xmalloc ();
+  objfile->macro_cache = bcache_xmalloc ();
   obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
                              xfree);
   obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
@@ -182,6 +184,7 @@ solib_add_common_symbols (CORE_ADDR rtc_symp)
                                  xmalloc, xfree);
       rt_common_objfile->minimal_symbol_count = 0;
       rt_common_objfile->msymbols = NULL;
+      terminate_minimal_symbol_table (rt_common_objfile);
     }
 
   init_minimal_symbol_collection ();
@@ -728,8 +731,8 @@ sunos_relocate_main_executable (void)
       displacement = pc - bfd_get_start_address (exec_bfd);
       changed = 0;
 
-      new_offsets = xcalloc (sizeof (struct section_offsets),
-                            symfile_objfile->num_sections);
+      new_offsets = xcalloc (symfile_objfile->num_sections,
+                            sizeof (struct section_offsets));
       old_chain = make_cleanup (xfree, new_offsets);
 
       for (i = 0; i < symfile_objfile->num_sections; i++)
@@ -852,8 +855,7 @@ sunos_solib_create_inferior_hook (void)
       warning ("shared library handler failed to disable breakpoint");
     }
 
-  if (auto_solib_add)
-    solib_add ((char *) 0, 0, (struct target_ops *) 0);
+  solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
 }
 
 static void