* dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of

bfd_get_section_size_before_reloc or _raw_size.
	* dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
	* dwarf2read.c (dwarf2_locate_sections): Likewise.
	(dwarf2_read_section): Likewise.
	* elfread.c (elf_locate_sections): Likewise.
	* gcore.c (derive_heap_segment): Likewise.
	* mipsread.c (read_alphacoff_dynamic_symtab): Likewise.
	* remote-e7000.c (e7000_load): Likewise.
	* remote-m32r-sdi.c (m32r_load): Likewise.
	* remote-mips.c (mips_load_srec): Likewise.
	(pmon_load_fast): Likewise.
	* remote.c (compare_sections_command): Likewise.
	* symfile.c (add_section_size_callback): Likewise.
	(load_section_callback): Likewise.
	(pc_in_unmapped_range): Likewise.
	(pc_in_mapped_range): Likewise.
	(sections_overlap): Likewise.
	(list_overlays_command): Likewise.
	(simple_overlay_update_1): Likewise.
	(simple_overlay_update): Likewise.
	* tracepoint.c (remote_set_transparent_ranges): Likewise.
	* win32-nat.c (core_section_load_dll_symbols): Likewise.
This commit is contained in:
Alan Modra
2004-06-15 01:04:20 +00:00
parent 1bf404efc4
commit 2c500098f2
15 changed files with 88 additions and 62 deletions

View File

@@ -1,7 +1,7 @@
/* Target-vector operations for controlling win32 child processes, for GDB.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free
Software Foundation, Inc.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by Cygnus Solutions, A Red Hat Company.
@@ -2340,20 +2340,20 @@ core_section_load_dll_symbols (bfd * abfd, asection * sect, void *obj)
if (strncmp (sect->name, ".module", 7))
return;
buf = (char *) xmalloc (sect->_raw_size + 1);
buf = (char *) xmalloc (bfd_get_section_size (sect) + 1);
if (!buf)
{
printf_unfiltered ("memory allocation failed for %s\n", sect->name);
goto out;
}
if (!bfd_get_section_contents (abfd, sect, buf, 0, sect->_raw_size))
if (!bfd_get_section_contents (abfd, sect, buf, 0, bfd_get_section_size (sect)))
goto out;
pstatus = (struct win32_pstatus *) buf;
memmove (&base_addr, &(pstatus->data.module_info.base_address), sizeof (base_addr));
dll_name_size = pstatus->data.module_info.module_name_size;
if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > sect->_raw_size)
if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > bfd_get_section_size (sect))
goto out;
dll_name = (char *) xmalloc (dll_name_size + 1);