This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: A question about display_archive in binutils
Hi Nick,
Thanks for your response!
Best Regards
Nan Xiao
On Wed, Oct 18, 2017 at 10:17 PM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Nan Xiao,
>
>> Greetings from me!
>
> Hi! :-)
>
>> if (last_arfile != NULL)
>> - bfd_close (last_arfile);
>> + {
>> + bfd_close (last_arfile);
>> +
>> + /* PR 17512: file: a244edbc. */
>> + if (last_arfile == arfile)
>> + return;
>> + }
>>
>> I am a little confused why there will occur last_arfile is equal
>> to arfile. So it means bfd_openr_next_archived_file allocates the
>> same memory in 2 consecutive times?
>
> That is correct. If the input file is a corrupt archive then it can
> confuse the code in bfd_openr_next_archived_file and so the same BFD
> can be returned multiple times. Try running size or nm with the file
> referenced in the comment to see this happening.
>
> Cheers
> Nick
>
>