[committed, PATCH] Properly convert objects between different ELF classes
H.J. Lu
hjl.tools@gmail.com
Thu Sep 24 15:12:00 GMT 2015
On Thu, Sep 24, 2015 at 8:10 AM, Andrew Stubbs <ams@codesourcery.com> wrote:
> 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?
Can you add a testcase?
--
H.J.
More information about the Binutils
mailing list