11c397e
diff -rup ../binutils-2.19.51.0.10.orig/bfd/elfcode.h ./bfd/elfcode.h
11c397e
--- ../binutils-2.19.51.0.10.orig/bfd/elfcode.h	2009-06-22 16:16:08.000000000 +0100
11c397e
+++ ./bfd/elfcode.h	2009-06-22 16:20:00.000000000 +0100
11c397e
@@ -1170,6 +1170,20 @@ 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
+	    {
11c397e
+	      if (sec->contents == NULL
11c397e
+		  && ! bfd_malloc_and_get_section (abfd, sec, & sec->contents))
11c397e
+		continue;
15996d5
+	      if (sec->contents != NULL)
15996d5
+		(*process) (sec->contents, i_shdr.sh_size, arg);
15996d5
+	    }
15996d5
+	}
15996d5
     }
15996d5
 
15996d5
   return TRUE;
11c397e
diff -rup ../binutils-2.19.51.0.10.orig/bfd/section.c ./bfd/section.c
11c397e
--- ../binutils-2.19.51.0.10.orig/bfd/section.c	2009-06-22 16:16:08.000000000 +0100
11c397e
+++ ./bfd/section.c	2009-06-22 16:20:42.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;