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 | 7a9af8c4a0fdb228854799a8b96eef29932a2004 (patch) | |
tree | 6058a20318647c078855081e1aa71fccc346b29b /bfd/elf64-hppa.c | |
parent | ded0649cd504e9895ab37f7ffae110d00ebbaaef (diff) | |
download | gdb-7a9af8c4a0fdb228854799a8b96eef29932a2004.zip gdb-7a9af8c4a0fdb228854799a8b96eef29932a2004.tar.gz gdb-7a9af8c4a0fdb228854799a8b96eef29932a2004.tar.bz2 |
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/elf64-hppa.c')
-rw-r--r-- | bfd/elf64-hppa.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index b5edaf1..fc102aa 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -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; } |