diff options
author | Nick Clifton <nickc@redhat.com> | 2000-08-21 23:42:56 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-08-21 23:42:56 +0000 |
commit | 4312772e904497af1e484bb8a4aa35ca8be98607 (patch) | |
tree | 96eb4f7b0900fac86be7219144d46ed56af5eb5e /bfd/elf32-i386.c | |
parent | c26b87fc09c67eeaeaa3e027f15e2187b7dd5108 (diff) | |
download | gdb-4312772e904497af1e484bb8a4aa35ca8be98607.tar.gz |
Zero out the dynamic allocated content space. Add a comment to remind us that
one day this ought to be fixed.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index ace82876df9..bed03150921 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -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; } |