Created attachment 6583 [details] test program BFD makes a hash table for archive members, but then leaks it. See http://sourceware.org/ml/binutils/2012-07/msg00162.html You can see the leak under valgrind using this program. Be sure to run it on a normal archive, a thin archive, and a thin archive that contains another archive.
*** Bug 14482 has been marked as a duplicate of this bug. ***
CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2012-08-16 20:31:35 Modified files: binutils : ChangeLog Makefile.am Makefile.in binutils/testsuite: ChangeLog binutils/testsuite/binutils-all: ar.exp Added files: binutils : bfdtest1.c Log message: Add a testcase for PR binutils/14481 binutils/ PR binutils/14481 * Makefile.am (BFDTEST1_PROG): New. (TEST_PROGS): Likewise. (bfdtest1_DEPENDENCIES): Likewise. (noinst_PROGRAMS): Add $(TEST_PROGS). * Makefile.in: Regenerated. * bfdtest1.c: New file. binutils/testsuite/ PR binutils/14481 * ar.exp (bfdtest1): New. (long_filenames): Run bfdtest1. (thin_archive): Likewise. (thin_archive_with_nested): Likewise. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/bfdtest1.c.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/ChangeLog.diff?cvsroot=src&r1=1.1932&r2=1.1933 http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/Makefile.am.diff?cvsroot=src&r1=1.135&r2=1.136 http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/Makefile.in.diff?cvsroot=src&r1=1.160&r2=1.161 http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/testsuite/ChangeLog.diff?cvsroot=src&r1=1.265&r2=1.266 http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/testsuite/binutils-all/ar.exp.diff?cvsroot=src&r1=1.16&r2=1.17
I checked in a testcase.
bfdtest1 test fail on targets which don't use archive implementation in archive.c. They include a.out and VMS targets.
CVSROOT: /cvs/src Module name: src Changes by: hp@sourceware.org 2012-11-07 05:51:37 Modified files: bfd : ChangeLog aout-target.h Log message: PR binutils/14481 * aout-target.h (MY_close_and_cleanup): Make local function instead of alias of MY_bfd_free_cached_info. Also call _bfd_generic_close_and_cleanup. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5848&r2=1.5849 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/aout-target.h.diff?cvsroot=src&r1=1.43&r2=1.44
(In reply to comment #5) > Changes by: hp@sourceware.org 2012-11-07 05:51:37 > > Modified files: > bfd : ChangeLog aout-target.h Please note that this was a fix only for *most* *a.out* targets. To wit, it does not fix all targets and not all a.out targets. See <http://sourceware.org/ml/binutils/2012-11/msg00078.html>.
I think this is mostly fixed, and what might not have been fixed is obsolete.