fdf1169
diff -rup ../binutils-2.19.51.0.11.orig/bfd/elfcode.h bfd/elfcode.h
fdf1169
--- ../binutils-2.19.51.0.11.orig/bfd/elfcode.h	2009-07-14 11:23:27.000000000 +0100
fdf1169
+++ bfd/elfcode.h	2009-07-14 11:33:56.000000000 +0100
fdf1169
@@ -1170,6 +1170,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;
fdf1169
diff -rup ../binutils-2.19.51.0.11.orig/bfd/section.c bfd/section.c
fdf1169
--- ../binutils-2.19.51.0.11.orig/bfd/section.c	2009-07-14 11:23:27.000000000 +0100
fdf1169
+++ bfd/section.c	2009-07-14 11:33:26.000000000 +0100
11c397e
@@ -1477,7 +1477,7 @@ bfd_malloc_and_get_section (bfd *abfd, s
11c397e
   if (sz == 0)
11c397e
     return TRUE;
11c397e
 
11c397e
-  p = bfd_malloc (sec->rawsize > sec->size ? sec->rawsize : sec->size);
11c397e
+  p = bfd_zmalloc (sec->rawsize > sec->size ? sec->rawsize : sec->size);
11c397e
   if (p == NULL)
11c397e
     return FALSE;
11c397e
   *buf = p;