summaryrefslogtreecommitdiff
path: root/gdb/pa64solib.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-06-06 23:33:00 +0000
committerMark Mitchell <mark@codesourcery.com>2003-06-06 23:33:00 +0000
commit1b556c4c3bc27c8326d055453ced5b931319a272 (patch)
tree03391592152e534b23fa34ddfc99463c933d5ffe /gdb/pa64solib.c
parent54b38ab9d018f850037e5192ac34841dab6fabac (diff)
downloadgdb-1b556c4c3bc27c8326d055453ced5b931319a272.tar.gz
* elfread.c (elf_symtab_read): Avoid use of SECT_OFF_MAX.
(elfstab_offset_sections): Likewise. * gdb-stabs.h (stab_section_info): Likewise. * i386-interix-tdep.c (pei_adjust_objfile_offsets): Likewise. * objfiles.c (objfile_relocate): Likewise. * pa64solib.c (pa64_solib_add_solib_objfile): Likewise. * remote.c (get_offsets): Likewise. (remote_cisco_objfile_relocate): Likewise. * somread.c (som_symfile_offsets): Likewise. * symfile.c (alloc_section_addr_info): New function. (build_section_addr_info_from_section_tab): Use it. (free_section_addr_info): Adjust. (default_symfile_offsets): Avoid use of SECT_OFF_MAX. (syms_from_objfile): Allocate local_addr dynamically. (symbol_file_add_with_addrs_or_offsets): Allocate orig_addrs dynamically. (add_symbol_file_command): Allocate sect_opts dynamically. (reread_symbols): Avoid use of SECT_OFF_MAX. * symfile.h (section_addr_info): Do not use MAX_SECTIONS. (alloc_section_addr_info): Declare it. * symtab.h (SIZEOF_SECTION_OFFSETS): Remove. * win32-nat.c (solib_symbols_add): Allocate section_addrs dynamically. * xcoffread.c (xcoff_symfile_offsets): Avoid use of SECT_OFF_MAX.
Diffstat (limited to 'gdb/pa64solib.c')
-rw-r--r--gdb/pa64solib.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/pa64solib.c b/gdb/pa64solib.c
index 43910dad46f..b67532d3759 100644
--- a/gdb/pa64solib.c
+++ b/gdb/pa64solib.c
@@ -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