2006-12-31 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 31 Dec 2006 17:23:07 +0000 (17:23 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 31 Dec 2006 17:23:07 +0000 (17:23 +0000)
* bfd.c (bfd_record_phdr): Call bfd_zalloc instead of bfd_alloc
to allocate elf_segment_map.

bfd/ChangeLog
bfd/bfd.c

index 5a74f9c5e4b4b9a61c010a515bbaae437f88b310..1ffb1a8eb92cd0f178cd241de5df36cfce903c8f 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-31  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * bfd.c (bfd_record_phdr): Call bfd_zalloc instead of bfd_alloc
+       to allocate elf_segment_map.
+
 2006-12-29  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elflink.c (elf_link_add_object_symbols): Remember the symbol
index b9701416a6094836b398b93f323076dd891633d2..79ae8a98a7c37719b6878f5d4243a3776306c521 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1352,11 +1352,10 @@ bfd_record_phdr (bfd *abfd,
 
   amt = sizeof (struct elf_segment_map);
   amt += ((bfd_size_type) count - 1) * sizeof (asection *);
-  m = bfd_alloc (abfd, amt);
+  m = bfd_zalloc (abfd, amt);
   if (m == NULL)
     return FALSE;
 
-  m->next = NULL;
   m->p_type = type;
   m->p_flags = flags;
   m->p_paddr = at;
@@ -1365,8 +1364,6 @@ bfd_record_phdr (bfd *abfd,
   m->includes_filehdr = includes_filehdr;
   m->includes_phdrs = includes_phdrs;
   m->count = count;
-  m->p_align_valid = FALSE;
-  m->p_align = 0;
   if (count > 0)
     memcpy (m->sections, secs, count * sizeof (asection *));