]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't free linker hash table
authorAlan Modra <amodra@gmail.com>
Wed, 18 Jun 2014 00:21:10 +0000 (09:51 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 18 Jun 2014 00:21:28 +0000 (09:51 +0930)
PR 17047
* ldlang.c (lang_finish): Don't free linker hash table.

ld/ChangeLog
ld/ldlang.c

index a6e8d3c7c3b6743d5e1f1b5592befef28f66240b..a8e4db6111e3e6f43487a0c0072cf954cfb693c0 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-18  Alan Modra  <amodra@gmail.com>
+
+       PR 17047
+       * ldlang.c (lang_finish): Don't free linker hash table.
+
 2014-06-17  Alan Modra  <amodra@gmail.com>
 
        * scripttempl/elf.sc: Edit out __rela_iplt symbol assignments from
index ba7f493bee108515df539f3ba8c007d89ae54c99..9121aa2757ad8c5400904adae4859331102a5b6b 100644 (file)
@@ -1238,7 +1238,14 @@ lang_init (void)
 void
 lang_finish (void)
 {
+  /* Some targets require access to the linker hash table during the
+     _bfd_write_contents call in bfd_close, so it can't be freed
+     before bfd_close.  It can't be freed after bfd_close either,
+     since bfd_alloc memory holding side data structures disappears
+     (PR17047).  So don't free it.
+
   bfd_link_hash_table_free (link_info.output_bfd, link_info.hash);
+  */
   bfd_hash_table_free (&lang_definedness_table);
   output_section_statement_table_free ();
 }