This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Thu, Aug 16, 2012 at 11:02:18AM -0600, Tom Tromey wrote:
> Another possible fix for this bug would be to allocate the areltdata
> using malloc.  That way it would be immune to the objalloc_free call.
> This would require a few more tweaks, like properly freeing it in
> _bfd_delete_bfd, etc.
> 
> I'm happy to make and test this change if you think it would be better.

Yes, I do think that would be better.  bfd_free_cached_info is called
only in one place, and the whole point of the call is as the comment
says
	  /* Now ask the BFD to free up any cached information, so we
	     don't fill all of memory with symbol tables.  */

If you don't free the bfd memory there isn't much point in having
bfd_free_cached_info!

> 	* opncls.c (_bfd_delete_bfd): Check to see if section htab is
> 	already freed.

This part can be committed now if you like.

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]