This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 3/5] remove deleted BFDs from the archive cache
On Fri, Aug 17, 2012 at 11:17 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "HJ" == H J Lu <hjl.tools@gmail.com> writes:
>
> HJ> archive = bfd_openr (argv[1], NULL);
> HJ> for (last = bfd_openr_next_archived_file (archive, NULL);
> HJ> last;
> HJ> last = next)
> HJ> {
> HJ> next = bfd_openr_next_archived_file (archive, last);
> HJ> bfd_close (last);
> HJ> }
>
> HJ> will bfd_close (last) call free (abfd->arelt_data)?
>
> By 'abfd->arelt_data' I guess you mean 'last->arelt_data'.
>
> HJ> If it does, archive bfd will have bad member arelt_data.
>
> How do you figure?
>
> I tried this with my patch in place using my archive-reading program
> (the one I stuck in whatever PR it was), running under valgrind. It
> does the above. I didn't see any issue. I don't understand how such a
> problem could possibly arise.
>
Your patch is probably OK.
--
H.J.