[PATCH 3/5] remove deleted BFDs from the archive cache

Tom Tromey tromey@redhat.com
Fri Aug 17 19:03:00 GMT 2012


>>>>> "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.

Tom



More information about the Binutils mailing list