diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2014-05-10 02:50:01 +0200 |
---|---|---|
committer | Hans-Peter Nilsson <hp@bitrange.com> | 2014-05-10 02:52:14 +0200 |
commit | eae25ec5773e12af107e65fcf0c94a54bc5180ae (patch) | |
tree | 584bbe1178f76697d0cea1e843819b9027d8c0f3 /ld/ldmain.c | |
parent | b1f02b89ed9e9c68eab6f645e19634315a6525c4 (diff) | |
download | gdb-eae25ec5773e12af107e65fcf0c94a54bc5180ae.zip gdb-eae25ec5773e12af107e65fcf0c94a54bc5180ae.tar.gz gdb-eae25ec5773e12af107e65fcf0c94a54bc5180ae.tar.bz2 |
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.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index 4c7ea68..2d987b8 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -171,6 +171,10 @@ ld_cleanup (void) #endif if (output_filename && delete_output_file_on_failure) unlink_if_ordinary (output_filename); + + /* See open_output in ldlang.c. */ + if (output_bfd_hash_table_free_fn != NULL) + (*output_bfd_hash_table_free_fn) (link_info.hash); } /* If there's a BFD assertion, we'll notice and exit with an error |