711d8b6
diff -rcp ../binutils-2.20.51.0.7.original/bfd/elfcode.h ./bfd/elfcode.h
711d8b6
*** ../binutils-2.20.51.0.7.original/bfd/elfcode.h	2010-04-08 15:29:32.000000000 +0100
711d8b6
--- ./bfd/elfcode.h	2010-04-08 15:29:39.000000000 +0100
711d8b6
*************** elf_checksum_contents (bfd *abfd,
711d8b6
*** 1188,1193 ****
711d8b6
--- 1188,1211 ----
711d8b6
  
711d8b6
        if (i_shdr.contents)
711d8b6
  	(*process) (i_shdr.contents, i_shdr.sh_size, arg);
711d8b6
+       else
711d8b6
+ 	{
711d8b6
+ 	  asection *sec;
711d8b6
+ 
711d8b6
+ 	  sec = bfd_section_from_elf_index (abfd, count);
711d8b6
+ 	  if (sec != NULL)
711d8b6
+ 	    {
711d8b6
+ 	      if (sec->contents == NULL)
711d8b6
+ 		{
711d8b6
+ 		  /* Force rereading from file.  */
711d8b6
+ 		  sec->flags &= ~SEC_IN_MEMORY;
711d8b6
+ 		  if (! bfd_malloc_and_get_section (abfd, sec, & sec->contents))
711d8b6
+ 		    continue;
711d8b6
+ 		}
711d8b6
+ 	      if (sec->contents != NULL)
711d8b6
+ 		(*process) (sec->contents, i_shdr.sh_size, arg);
711d8b6
+ 	    }
711d8b6
+ 	}
711d8b6
      }
711d8b6
  
711d8b6
    return TRUE;
711d8b6
diff -rcp ../binutils-2.20.51.0.7.original/bfd/section.c ./bfd/section.c
711d8b6
*** ../binutils-2.20.51.0.7.original/bfd/section.c	2010-04-08 15:29:32.000000000 +0100
711d8b6
--- ./bfd/section.c	2010-04-08 15:29:39.000000000 +0100
711d8b6
*************** bfd_malloc_and_get_section (bfd *abfd, s
711d8b6
*** 1488,1494 ****
711d8b6
      return TRUE;
711d8b6
  
711d8b6
    p = (bfd_byte *)
711d8b6
!       bfd_malloc (sec->rawsize > sec->size ? sec->rawsize : sec->size);
711d8b6
    if (p == NULL)
711d8b6
      return FALSE;
711d8b6
    *buf = p;
711d8b6
--- 1488,1494 ----
711d8b6
      return TRUE;
711d8b6
  
711d8b6
    p = (bfd_byte *)
711d8b6
!       bfd_zmalloc (sec->rawsize > sec->size ? sec->rawsize : sec->size);
711d8b6
    if (p == NULL)
711d8b6
      return FALSE;
711d8b6
    *buf = p;
711d8b6
diff -rcp ../binutils-2.20.51.0.7.original/bfd/section.c.orig ./bfd/section.c.orig