* solib.c (update_solib_list): Move target_resize_to_sections()

into solib_map_sections() loop.
	(info_sharedlibrary_command): Try bfd_arch_bits_per_address() if
	bfd_get_arch_size() fails.
This commit is contained in:
Nicholas Duffek 2001-05-26 00:55:11 +00:00
parent a1cd19081d
commit b41be06e3b
2 changed files with 19 additions and 19 deletions

View File

@ -1,3 +1,10 @@
2001-05-25 Nick Duffek <nsd@redhat.com>
* solib.c (update_solib_list): Move target_resize_to_sections()
into solib_map_sections() loop.
(info_sharedlibrary_command): Try bfd_arch_bits_per_address() if
bfd_get_arch_size() fails.
2001-05-25 Nick Duffek <nsd@redhat.com> 2001-05-25 Nick Duffek <nsd@redhat.com>
* Makefile.in (osfsolib.c, osfsolib.o): Rename to solib-osf.c and * Makefile.in (osfsolib.c, osfsolib.o): Rename to solib-osf.c and

View File

@ -461,30 +461,20 @@ update_solib_list (int from_tty, struct target_ops *target)
catch_errors (solib_map_sections, i, catch_errors (solib_map_sections, i,
"Error while mapping shared library sections:\n", "Error while mapping shared library sections:\n",
RETURN_MASK_ALL); RETURN_MASK_ALL);
}
/* If requested, add the shared objects' sections to the the /* If requested, add the shared object's sections to the TARGET's
TARGET's section table. */ section table. Do this immediately after mapping the object so
if (target) that later nodes in the list can query this object, as is needed
{ in solib-osf.c. */
int new_sections; if (target)
/* Figure out how many sections we'll need to add in total. */
new_sections = 0;
for (i = inferior; i; i = i->next)
new_sections += (i->sections_end - i->sections);
if (new_sections > 0)
{ {
int space = target_resize_to_sections (target, new_sections); int count = (i->sections_end - i->sections);
if (count > 0)
for (i = inferior; i; i = i->next)
{ {
int count = (i->sections_end - i->sections); int space = target_resize_to_sections (target, count);
memcpy (target->to_sections + space, memcpy (target->to_sections + space,
i->sections, i->sections,
count * sizeof (i->sections[0])); count * sizeof (i->sections[0]));
space += count;
} }
} }
} }
@ -605,7 +595,10 @@ info_sharedlibrary_command (char *ignore, int from_tty)
} }
arch_size = bfd_get_arch_size (exec_bfd); arch_size = bfd_get_arch_size (exec_bfd);
/* Default to 32-bit in case of failure (non-elf). */ if (arch_size == -1)
arch_size = bfd_arch_bits_per_address(exec_bfd);
/* Default to 32-bit in case of failure. */
if (arch_size == 32 || arch_size == -1) if (arch_size == 32 || arch_size == -1)
{ {
addr_width = 8 + 4; addr_width = 8 + 4;