Fri Apr 7 13:44:38 2000 glen mccready <gkm@pobox.com>
[deliverable/binutils-gdb.git] / gdb / pa64solib.c
index b0b4645d29f01004ec525db9f43c9780301eecab..271efc2367b7608e349208a5b62bdb27d75f6eb3 100644 (file)
@@ -226,7 +226,9 @@ pa64_solib_add_solib_objfile (so, name, from_tty, text_addr)
   bfd *tmp_bfd;
   asection *sec;
   obj_private_data_t *obj_private;
+  struct section_addr_info section_addrs;
 
+  memset (&section_addrs, 0, sizeof (section_addrs));
   /* We need the BFD so that we can look at its sections.  We open up the
      file temporarily, then close it when we are done.  */
   tmp_bfd = bfd_openr (name, gnutarget);
@@ -270,7 +272,8 @@ pa64_solib_add_solib_objfile (so, name, from_tty, text_addr)
   tmp_bfd = NULL;
 
   /* Now let the generic code load up symbols for this library.  */
-  so->objfile = symbol_file_add (name, from_tty, text_addr, 0, 0, 0, 0, 1);
+  section_addrs.text_addr = text_addr;
+  so->objfile = symbol_file_add (name, from_tty, &section_addrs, 0, OBJF_SHARED);
   so->abfd = so->objfile->obfd;
 
   /* Mark this as a shared library and save private data.  */
@@ -357,49 +360,12 @@ pa64_solib_load_symbols (so, name, from_tty, text_addr, target)
   status = target_read_memory (text_addr, buf, 4);
   if (status != 0)
     {
-      int old, new;
-      int update_coreops;
-      int update_execops;
-
-      /* We must update the to_sections field in the core_ops structure
-        here, otherwise we dereference a potential dangling pointer
-        for each call to target_read/write_memory within this routine.  */
-      update_coreops = core_ops.to_sections == target->to_sections;
-
-      /* Ditto exec_ops (this was a bug).  */
-      update_execops = exec_ops.to_sections == target->to_sections;
-
+      int new, old;
+      
       new = so->sections_end - so->sections;
-      /* Add sections from the shared library to the core target.  */
-      if (target->to_sections)
-       {
-         old = target->to_sections_end - target->to_sections;
-         target->to_sections = (struct section_table *)
-           xrealloc ((char *) target->to_sections,
-                     ((sizeof (struct section_table)) * (old + new)));
-       }
-      else
-       {
-         old = 0;
-         target->to_sections = (struct section_table *)
-           xmalloc ((sizeof (struct section_table)) * new);
-       }
-      target->to_sections_end = (target->to_sections + old + new);
-
-      /* Update the to_sections field in the core_ops structure
-        if needed, ditto exec_ops.  */
-      if (update_coreops)
-       {
-         core_ops.to_sections = target->to_sections;
-         core_ops.to_sections_end = target->to_sections_end;
-       }
-
-      if (update_execops)
-       {
-         exec_ops.to_sections = target->to_sections;
-         exec_ops.to_sections_end = target->to_sections_end;
-       }
 
+      old = target_resize_to_sections (target, new);
+      
       /* Copy over the old data before it gets clobbered.  */
       memcpy ((char *) (target->to_sections + old),
              so->sections,
@@ -828,7 +794,7 @@ pa64_sharedlibrary_info_command (ignore, from_tty)
 
   if (exec_bfd == NULL)
     {
-      printf_unfiltered ("no exec file.\n");
+      printf_unfiltered ("No executable file.\n");
       return;
     }
 
This page took 0.030695 seconds and 4 git commands to generate.