Module Name: src Committed By: mhitch Date: Mon May 4 17:56:36 UTC 2009
Modified Files: src/gnu/dist/binutils/bfd: elf32-vax.c Log Message: Allocate relocation section using bfd_zalloc() to ensure no garbage relocations when not all the entries are used. Fixes PR port-vax/39182. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/gnu/dist/binutils/bfd/elf32-vax.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/gnu/dist/binutils/bfd/elf32-vax.c diff -u src/gnu/dist/binutils/bfd/elf32-vax.c:1.8 src/gnu/dist/binutils/bfd/elf32-vax.c:1.9 --- src/gnu/dist/binutils/bfd/elf32-vax.c:1.8 Sat Nov 1 15:09:11 2008 +++ src/gnu/dist/binutils/bfd/elf32-vax.c Mon May 4 17:56:35 2009 @@ -1310,7 +1310,12 @@ } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->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->size); if (s->contents == NULL && s->size != 0) return FALSE; }