2003-10-06 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / pa64solib.c
index fce8fea036510fb70a479e22c9ead9d85986f55b..b67532d37599711ac1e96ef8feaf9cc4f67c070b 100644 (file)
@@ -80,7 +80,7 @@ struct so_list
     struct load_module_desc pa64_solib_desc;
     struct section_table *sections;
     struct section_table *sections_end;
-    boolean loaded;
+    int loaded;
   };
 
 static struct so_list *so_list_head;
@@ -111,8 +111,8 @@ typedef struct
     CORE_ADDR dld_flags_addr;
     LONGEST dld_flags;
     sec_ptr dyninfo_sect;
-    boolean have_read_dld_descriptor;
-    boolean is_valid;
+    int have_read_dld_descriptor;
+    int is_valid;
     CORE_ADDR load_map;
     CORE_ADDR load_map_addr;
     struct load_module_desc dld_desc;
@@ -127,11 +127,11 @@ static void pa64_solib_sharedlibrary_command (char *, int);
 
 static void *pa64_target_read_memory (void *, CORE_ADDR, size_t, int);
 
-static boolean read_dld_descriptor (struct target_ops *, int readsyms);
+static int read_dld_descriptor (struct target_ops *, int readsyms);
 
-static boolean read_dynamic_info (asection *, dld_cache_t *);
+static int read_dynamic_info (asection *, dld_cache_t *);
 
-static void add_to_solist (boolean, char *, int, struct load_module_desc *,
+static void add_to_solist (int, char *, int, struct load_module_desc *,
                           CORE_ADDR, struct target_ops *);
 
 /* When examining the shared library for debugging information we have to
@@ -222,9 +222,9 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
   bfd *tmp_bfd;
   asection *sec;
   obj_private_data_t *obj_private;
-  struct section_addr_info section_addrs;
+  struct section_addr_info *section_addrs;
+  struct cleanup *my_cleanups;
 
-  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);
@@ -262,15 +262,18 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
       text_addr += sec->filepos;
     }
 
+  section_addrs = alloc_section_addr_info (bfd_count_sections (tmp_bfd));
+  my_cleanups = make_cleanup (xfree, section_addrs);
+
   /* We are done with the temporary bfd.  Get rid of it and make sure
      nobody else can us it.  */
   bfd_close (tmp_bfd);
   tmp_bfd = NULL;
 
   /* Now let the generic code load up symbols for this library.  */
-  section_addrs.other[0].addr = text_addr;
-  section_addrs.other[0].name = ".text";
-  so->objfile = symbol_file_add (name, from_tty, &section_addrs, 0, OBJF_SHARED);
+  section_addrs->other[0].addr = text_addr;
+  section_addrs->other[0].name = ".text";
+  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.  */
@@ -289,6 +292,7 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
   obj_private = (obj_private_data_t *) so->objfile->obj_private;
   obj_private->so_info = so;
   obj_private->dp = so->pa64_solib_desc.linkage_ptr;
+  do_cleanups (my_cleanups);
 }
 
 /* Load debugging information for a shared library.  TARGET may be
@@ -935,7 +939,7 @@ so_lib_thread_start_addr (struct so_list *so)
    descriptor.  If the library is archive bound, then return zero, else
    return nonzero.  */
 
-static boolean
+static int
 read_dld_descriptor (struct target_ops *target, int readsyms)
 {
   char *dll_path;
@@ -1004,7 +1008,7 @@ read_dld_descriptor (struct target_ops *target, int readsyms)
    which is stored in dld_cache.  The routine elf_locate_base in solib.c 
    was used as a model for this.  */
 
-static boolean
+static int
 read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
 {
   char *buf;
@@ -1102,7 +1106,7 @@ pa64_target_read_memory (void *buffer, CORE_ADDR ptr, size_t bufsiz, int ident)
    be read from the inferior process at the address load_module_desc_addr.  */
 
 static void
-add_to_solist (boolean from_tty, char *dll_path, int readsyms,
+add_to_solist (int from_tty, char *dll_path, int readsyms,
               struct load_module_desc *load_module_desc_p,
               CORE_ADDR load_module_desc_addr, struct target_ops *target)
 {
This page took 0.024777 seconds and 4 git commands to generate.