Fix freeing of link_info.hash
authorHans-Peter Nilsson <hp@bitrange.com>
Sat, 10 May 2014 00:50:01 +0000 (02:50 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Sat, 10 May 2014 00:52:14 +0000 (02:52 +0200)
commiteae25ec5773e12af107e65fcf0c94a54bc5180ae
tree584bbe1178f76697d0cea1e843819b9027d8c0f3
parentb1f02b89ed9e9c68eab6f645e19634315a6525c4
Fix freeing of link_info.hash

ld:
* ldlang.c (lang_finish): Don't call bfd_link_hash_table_free here.
(output_bfd_hash_table_free_fn): New variable.
(open_output): Save the _bfd_link_hash_table_free function for the
output_bfd into output_bfd_hash_table_free_fn.
* ldmain.c (ld_cleanup): If set, call output_bfd_hash_table_free_fn
on link_info.hash.
* ldlang.h (output_bfd_hash_table_free_fn): Declare.

ld/testsuite:
* ld-mmix/wrap1.d, ld-mmix/wrap1a.s, ld-mmix/wrap1b.s,
ld-mmix/wrap1c.s, ld-mmix/wrap2.d, ld-mmix/wrap3.d,
ld-mmix/wrap3a.s, ld-mmix/wrap3b.s, ld-mmix/wrap4.d: New
tests.
14 files changed:
ld/ChangeLog
ld/ldlang.c
ld/ldlang.h
ld/ldmain.c
ld/testsuite/ChangeLog
ld/testsuite/ld-mmix/wrap1.d [new file with mode: 0644]
ld/testsuite/ld-mmix/wrap1a.s [new file with mode: 0644]
ld/testsuite/ld-mmix/wrap1b.s [new file with mode: 0644]
ld/testsuite/ld-mmix/wrap1c.s [new file with mode: 0644]
ld/testsuite/ld-mmix/wrap2.d [new file with mode: 0644]
ld/testsuite/ld-mmix/wrap3.d [new file with mode: 0644]
ld/testsuite/ld-mmix/wrap3a.s [new file with mode: 0644]
ld/testsuite/ld-mmix/wrap3b.s [new file with mode: 0644]
ld/testsuite/ld-mmix/wrap4.d [new file with mode: 0644]