Zero the buffer containing the .gnu_debuglink section before writing

into it.  Prior to this commit the .gnu_debuglink section can have up
to 3 bytes of uninitialized garbage; as a result, .ko files could
change vary between builds.

Approved by:	dim
MFC after:	7 days
This commit is contained in:
Colin Percival 2010-11-11 00:29:19 +00:00
parent 0ea0127a4d
commit 4a56bb2033

View File

@ -1151,7 +1151,7 @@ bfd_fill_in_gnu_debuglink_section (bfd *abfd,
debuglink_size &= ~3;
debuglink_size += 4;
contents = malloc (debuglink_size);
contents = bfd_zmalloc (debuglink_size);
if (contents == NULL)
{
/* XXX Should we delete the section from the bfd ? */