This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]