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: [RFA:] fix linker deallocation bug: link_info.hash deallocated too soon


On Thu, May 08, 2014 at 07:27:02AM -0400, Hans-Peter Nilsson wrote:
> At first I tried plainly moving the bfd_link_hash_table_free call into
> ld_cleanup, but valgrind alerted me that bfd_link_hash_table_free
> needs to deference the (deallocated) output_bfd.  The hash_table_free
> function is "virtual"; it needs to dereference the BFD xvec "vtable".

I think it still makes sense to use ld_cleanup, simply to avoid
another atexit function.  Also, set output_bfd_hash_table_free_fn
in open_output, after the hash table is created.  The patch is OK with
those changes.

-- 
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]