This is the mail archive of the
mailing list for the binutils project.
Re: [committed, PATCH] Properly convert objects between different ELF classes
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Andrew Stubbs <ams at codesourcery dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 24 Sep 2015 08:12:11 -0700
- Subject: Re: [committed, PATCH] Properly convert objects between different ELF classes
- Authentication-results: sourceware.org; auth=none
- References: <20150710214315 dot GA17734 at intel dot com> <56041251 dot 6060203 at codesourcery dot com>
On Thu, Sep 24, 2015 at 8:10 AM, Andrew Stubbs <email@example.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?