[committed, PATCH] Properly convert objects between different ELF classes

Andrew Stubbs ams@codesourcery.com
Thu Sep 24 15:10:00 GMT 2015


On 10/07/15 22:43, H.J. Lu wrote:
> -  size = bfd_get_section_size (isection);
> +  /* The output SHF_COMPRESSED section size is different from input if
> +     ELF classes of input and output aren't the same.  We must use the
> +     output section size here, which has been updated in setup_section
> +     via bfd_convert_section_size.  */
> +  size = bfd_get_section_size (osection);

This change has broken objcopy when padding has been added to the output 
section size. In my case, the output is binary format.

The bug causes a buffer read overrun which results in intermittent 
failures. It also looks like it will break byte reversal and interleaving.

The attached patch fixes the problem.

OK to commit?

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sb-5811.patch
Type: text/x-patch
Size: 1691 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150924/724392dd/attachment.bin>


More information about the Binutils mailing list