Allocate elf_segment_map with bfd_zalloc
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Nov 2012 22:54:21 +0000 (22:54 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Nov 2012 22:54:21 +0000 (22:54 +0000)
* elf.c (rewrite_elf_program_header): Allocate elf_segment_map
with bfd_zalloc, instead of bfd_alloc.

bfd/ChangeLog
bfd/elf.c

index e18411e5022f7231989836e7fc811372ec371b8b..971723757e911fbc98f6a3415e506a17357ce6c8 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-13  Joe Seymour  <jseymour@codesourcery.com>
+
+       * elf.c (rewrite_elf_program_header): Allocate elf_segment_map
+       with bfd_zalloc, instead of bfd_alloc.
+
 2012-11-09  Nick Clifton  <nickc@redhat.com>
 
        * Makefile.am (ALL_MACHINES): Add cpu-v850-rh850.lo.
index f40e81bbd52c4c310662e64c5ba346e17a83e147..b8bb6d3f93a037728524a86fc65be97a2ad5fa0f 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6043,7 +6043,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
                 and carry on looping.  */
              amt = sizeof (struct elf_segment_map);
              amt += ((bfd_size_type) section_count - 1) * sizeof (asection *);
-             map = (struct elf_segment_map *) bfd_alloc (obfd, amt);
+             map = (struct elf_segment_map *) bfd_zalloc (obfd, amt);
              if (map == NULL)
                {
                  free (sections);