2055b15
--- ../binutils-2.20.51.0.2.orig/bfd/elfcode.h	2009-10-12 11:45:05.000000000 +0100
2055b15
+++ bfd/elfcode.h	2009-10-12 11:47:14.000000000 +0100
2055b15
@@ -1175,6 +1175,24 @@ elf_checksum_contents (bfd *abfd,
15996d5
 
15996d5
       if (i_shdr.contents)
15996d5
 	(*process) (i_shdr.contents, i_shdr.sh_size, arg);
15996d5
+      else
15996d5
+	{
15996d5
+	  asection *sec;
15996d5
+
15996d5
+	  sec = bfd_section_from_elf_index (abfd, count);
15996d5
+	  if (sec != NULL)
15996d5
+	    {
fdf1169
+	      if (sec->contents == NULL)
fdf1169
+		{
fdf1169
+		  /* Force rereading from file.  */
fdf1169
+		  sec->flags &= ~SEC_IN_MEMORY;
fdf1169
+		  if (! bfd_malloc_and_get_section (abfd, sec, & sec->contents))
fdf1169
+		    continue;
fdf1169
+		}
15996d5
+	      if (sec->contents != NULL)
15996d5
+		(*process) (sec->contents, i_shdr.sh_size, arg);
15996d5
+	    }
15996d5
+	}
15996d5
     }
15996d5
 
15996d5
   return TRUE;
2055b15
--- ../binutils-2.20.51.0.2.orig/bfd/section.c	2009-10-12 11:45:05.000000000 +0100
2055b15
+++ bfd/section.c	2009-10-12 11:48:44.000000000 +0100
2055b15
@@ -1553,7 +1553,7 @@ bfd_malloc_and_get_section (bfd *abfd, s
11c397e
     return TRUE;
11c397e
 
2055b15
   p = (bfd_byte *)
2055b15
-      bfd_malloc (sec->rawsize > sec->size ? sec->rawsize : sec->size);
2055b15
+      bfd_zmalloc (sec->rawsize > sec->size ? sec->rawsize : sec->size);
11c397e
   if (p == NULL)
11c397e
     return FALSE;
11c397e
   *buf = p;