]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Zero out the dynamic allocated content space. Add a comment to remind us that
authorNick Clifton <nickc@redhat.com>
Mon, 21 Aug 2000 23:42:56 +0000 (23:42 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 21 Aug 2000 23:42:56 +0000 (23:42 +0000)
one day this ought to be fixed.

bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf32-m68k.c
bfd/elf32-sparc.c
bfd/elf64-hppa.c

index 85093807fcf4f1c408cbbdac92d5035e1521a71d..15e54dff23d734d7581a5540a8911ffce28a99fa 100644 (file)
@@ -1,3 +1,12 @@
+2000-08-21  H.J. Lu  <hjl@gnu.org>
+
+       * elf32-i386.c (elf_i386_size_dynamic_sections): Zero out the
+       dynamic allocated content space.  Add a comment to remind us that
+       one day this ought to be fixed.
+       * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
+       * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
+       * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
+
 2000-08-21  Jason Eckhardt  <jle@cygnus.com>
 
        * elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate
index ace82876df9680523733176fd167eb79744fc3a8..bed031509217b4eca0735a53f3f293ef7912b162 100644 (file)
@@ -1198,7 +1198,12 @@ elf_i386_size_dynamic_sections (output_bfd, info)
        }
 
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+      /* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
+        Unused entries should be reclaimed before the section's contents
+        are written out, but at the moment this does not happen.  Thus in
+        order to prevent writing out garbage, we initialise the section's
+        contents to zero.  */
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
       if (s->contents == NULL && s->_raw_size != 0)
        return false;
     }
index bee73b5a57d44a9fc799d95978cc864bcd058dde..96d636c5d1a2c6266ee94452f6ffed2a2eb67522 100644 (file)
@@ -1267,7 +1267,12 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
        }
 
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+      /* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
+        Unused entries should be reclaimed before the section's contents
+        are written out, but at the moment this does not happen.  Thus in
+        order to prevent writing out garbage, we initialise the section's
+        contents to zero.  */
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
       if (s->contents == NULL && s->_raw_size != 0)
        return false;
     }
index 002938479db1976667887cbbad1ab34d6dbe773a..1dd0351451380a0a891152f489fb05805e982c01 100644 (file)
@@ -1019,7 +1019,12 @@ elf32_sparc_size_dynamic_sections (output_bfd, info)
        }
 
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+      /* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
+        Unused entries should be reclaimed before the section's contents
+        are written out, but at the moment this does not happen.  Thus in
+        order to prevent writing out garbage, we initialise the section's
+        contents to zero.  */
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
       if (s->contents == NULL && s->_raw_size != 0)
        return false;
     }
index b5edaf14578f30722cfe1eec113fabb73944a1b5..fc102aa96f1871959d41c283f11f4b8fb4841ee3 100644 (file)
@@ -1740,7 +1740,12 @@ elf64_hppa_size_dynamic_sections (output_bfd, info)
         been allocated already.  */
       if (s->contents == NULL)
        {
-         s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+         /* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
+            Unused entries should be reclaimed before the section's contents
+            are written out, but at the moment this does not happen.  Thus in
+            order to prevent writing out garbage, we initialise the section's
+            contents to zero.  */
+         s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
          if (s->contents == NULL && s->_raw_size != 0)
            return false;
        }