diff -rcp ../binutils-2.20.51.0.7.original/bfd/elfcode.h ./bfd/elfcode.h *** ../binutils-2.20.51.0.7.original/bfd/elfcode.h 2010-04-08 15:29:32.000000000 +0100 --- ./bfd/elfcode.h 2010-04-08 15:29:39.000000000 +0100 *************** elf_checksum_contents (bfd *abfd, *** 1188,1193 **** --- 1188,1211 ---- if (i_shdr.contents) (*process) (i_shdr.contents, i_shdr.sh_size, arg); + else + { + asection *sec; + + sec = bfd_section_from_elf_index (abfd, count); + if (sec != NULL) + { + if (sec->contents == NULL) + { + /* Force rereading from file. */ + sec->flags &= ~SEC_IN_MEMORY; + if (! bfd_malloc_and_get_section (abfd, sec, & sec->contents)) + continue; + } + if (sec->contents != NULL) + (*process) (sec->contents, i_shdr.sh_size, arg); + } + } } return TRUE; diff -rcp ../binutils-2.20.51.0.7.original/bfd/section.c.orig ./bfd/section.c.orig *** ../binutils-2.20.51.0.11.orig/bfd/compress.c 2010-09-10 08:44:47.000000000 +0100 --- bfd/compress.c 2010-09-10 08:46:16.000000000 +0100 *************** bfd_get_full_section_contents (bfd *abfd *** 174,180 **** case COMPRESS_SECTION_NONE: if (p == NULL) { ! p = (bfd_byte *) bfd_malloc (sz); if (p == NULL) return FALSE; need_free = TRUE; --- 174,180 ---- case COMPRESS_SECTION_NONE: if (p == NULL) { ! p = (bfd_byte *) bfd_zmalloc (sz); if (p == NULL) return FALSE; need_free = TRUE; *************** fail_compressed: *** 234,240 **** uncompressed_buffer = p; else { ! uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size); if (uncompressed_buffer == NULL) goto fail_compressed; } --- 234,240 ---- uncompressed_buffer = p; else { ! uncompressed_buffer = (bfd_byte *) bfd_zmalloc (uncompressed_size); if (uncompressed_buffer == NULL) goto fail_compressed; }