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

H.J. Lu hjl.tools@gmail.com
Wed Aug 15 20:14:00 GMT 2012


On Thu, Aug 9, 2012 at 3:15 AM, Alan Modra <amodra@gmail.com> wrote:
> On Wed, Aug 08, 2012 at 11:21:02AM -0600, Tom Tromey wrote:
>> Alan, in a private note you mentioned using bfd_read_p in the check in
>> _bfd_archive_close_and_cleanup.
>
> I'm reasonably sure that the code as it was doesn't mess with archive
> bfds opened for writing, but wanted to make it obvious.  I've also
> moved the code setting new areltdata fields (and renamed them) to
> _bfd_add_bfd_to_archive_cache to make the code a bit tidier.
> Committed.
>
> 2012-08-09  Alan Modra  <amodra@gmail.com>
>             Tom Tromey  <tromey@redhat.com>
>
>         * archive.c (SECTION Archives): Update documentation.
>         (_bfd_delete_archive_data): Remove.
>         (_bfd_add_bfd_to_archive_cache): Set 'parent_cache' and 'key'.
>         (archive_close_worker, _bfd_archive_close_and_cleanup): New
>         functions.
>         * libbfd-in.h (struct areltdata <parent_cache, key>): New fields.
>         (_bfd_delete_archive_data): Don't declare.
>         (_bfd_archive_close_and_cleanup): Declare.
>         (_bfd_generic_close_and_cleanup): Redefine.
>         * libbfd.h: Rebuild.
>         * opncls.c (_bfd_delete_bfd): Don't call _bfd_delete_archive_data.
>         (bfd_close): Don't close nested thin archives here.
>
>

It breaks strip:

http://sourceware.org/bugzilla/show_bug.cgi?id=14475


-- 
H.J.



More information about the Binutils mailing list