[RFA:] fix linker deallocation bug: link_info.hash deallocated too soon

Alan Modra amodra@gmail.com
Fri May 9 03:06:00 GMT 2014


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



More information about the Binutils mailing list