* bfd-in.h (bfd_get_section_limit): Don't use rawsize with output

sections.
	* libbfd.c (_bfd_generic_get_section_contents): Likewise.
	(_bfd_generic_get_section_contents_in_window): Likewise.
	* section.c (bfd_get_section_contents): Likewise.
	* compress.c (bfd_get_full_section_contents): Likewise.
	* elf32-rx.c (rx_final_link): Ignore rawsize.
	* elf32-microblaze.c (microblaze_elf_relocate_section): Use correct
	bfd with bfd_get_section_limit.
	* elfxx-ia64.c (elfNN_ia64_choose_gp): Add "final" parameter.  Use
	os->size during final link.  Update callers.
	* bfd-in2.h: Regenerate.
This commit is contained in:
Alan Modra
2011-04-11 04:08:13 +00:00
parent 6edcf5b8e0
commit e57278ef9d
9 changed files with 62 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
/* Object file "section" support for the BFD library.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -1456,7 +1456,10 @@ bfd_get_section_contents (bfd *abfd,
return TRUE;
}
sz = section->rawsize ? section->rawsize : section->size;
if (abfd->direction != write_direction && section->rawsize != 0)
sz = section->rawsize;
else
sz = section->size;
if ((bfd_size_type) offset > sz
|| count > sz
|| offset + count > sz