Don't call bfd_link_hash_table_free
authorAlan Modra <amodra@gmail.com>
Fri, 13 Jun 2014 09:41:29 +0000 (19:11 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 13 Jun 2014 09:41:29 +0000 (19:11 +0930)
Freeing the linker hash table is a royal pain.  It can't be freed
before the _bfd_write_contents call in bfd_close, because some target
bfd_write_contents functions access the hash table.  It can't be freed
after bfd_close either, since bfd_alloc memory holding side data
structures disappears (PR17047).  Clearly the only place it can be freed
is actually in bfd_close.  This patch doesn't do that, but kills off
the existing means of freeing the hash table via a bfd target xvec call.

bfd/
PR 17047
* targets.c (BFD_JUMP_TABLE): Delete NAME##_bfd_link_hash_table_free.
(struct bfd_target <_bfd_link_hash_table_free>): Delete.
* bfd.c (bfd_link_hash_table_free): Don't define.
* aout-adobe.c, * aout-target.h, * aout-tic30.c, * binary.c, * bout.c,
* coff64-rs6000.c, * coffcode.h, * elf-m10300.c, * elf32-arm.c,
* elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc11.c,
* elf32-m68hc12.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c,
* elf32-sparc.c, * elf32-xgate.c, * elf64-ia64-vms.c, * elf64-ppc.c,
* elf64-sparc.c, * elf64-x86-64.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfxx-target.h, * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c,
* libbfd-in.h, * libecoff.h, * mach-o-target.c, * mmo.c,
* nlm-target.h, * oasys.c, * pef.c, * plugin.c, * ppcboot.c, * som.c,
* srec.c, * tekhex.c, * verilog.c, * versados.c, * vms-alpha.c,
* xsym.c: Don't define various link_hash_table_free defines, and
remove from bfd_target vars.  Temporarily reference some of the
target link_hash_table_free functions to avoid warnings.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
ld/
PR 17047
* ldlang.c (output_bfd_hash_table_free_fn): Delete.
(open_output): Don't set it..
* ldmain.c (ld_cleanup): ..or call it.

54 files changed:
bfd/ChangeLog
bfd/aout-adobe.c
bfd/aout-target.h
bfd/aout-tic30.c
bfd/bfd-in2.h
bfd/bfd.c
bfd/binary.c
bfd/bout.c
bfd/coff64-rs6000.c
bfd/coffcode.h
bfd/elf-m10300.c
bfd/elf32-arm.c
bfd/elf32-avr.c
bfd/elf32-hppa.c
bfd/elf32-i386.c
bfd/elf32-m68hc11.c
bfd/elf32-m68hc12.c
bfd/elf32-m68k.c
bfd/elf32-metag.c
bfd/elf32-nios2.c
bfd/elf32-sparc.c
bfd/elf32-xgate.c
bfd/elf64-ia64-vms.c
bfd/elf64-ppc.c
bfd/elf64-sparc.c
bfd/elf64-x86-64.c
bfd/elfnn-aarch64.c
bfd/elfnn-ia64.c
bfd/elfxx-target.h
bfd/i386msdos.c
bfd/i386os9k.c
bfd/ieee.c
bfd/ihex.c
bfd/libbfd-in.h
bfd/libbfd.h
bfd/libecoff.h
bfd/mach-o-target.c
bfd/mmo.c
bfd/nlm-target.h
bfd/oasys.c
bfd/pef.c
bfd/plugin.c
bfd/ppcboot.c
bfd/som.c
bfd/srec.c
bfd/targets.c
bfd/tekhex.c
bfd/verilog.c
bfd/versados.c
bfd/vms-alpha.c
bfd/xsym.c
ld/ChangeLog
ld/ldlang.c
ld/ldmain.c

index bfe234a295b9c09f5316d5b632ba503050cefe09..4cb3d06b9d6238355f167f6b911394337accb133 100644 (file)
@@ -1,3 +1,25 @@
+2014-06-13  Alan Modra  <amodra@gmail.com>
+
+       PR 17047
+       * targets.c (BFD_JUMP_TABLE): Delete NAME##_bfd_link_hash_table_free.
+       (struct bfd_target <_bfd_link_hash_table_free>): Delete.
+       * bfd.c (bfd_link_hash_table_free): Don't define.
+       * aout-adobe.c, * aout-target.h, * aout-tic30.c, * binary.c, * bout.c,
+       * coff64-rs6000.c, * coffcode.h, * elf-m10300.c, * elf32-arm.c,
+       * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc11.c,
+       * elf32-m68hc12.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c,
+       * elf32-sparc.c, * elf32-xgate.c, * elf64-ia64-vms.c, * elf64-ppc.c,
+       * elf64-sparc.c, * elf64-x86-64.c, * elfnn-aarch64.c, * elfnn-ia64.c,
+       * elfxx-target.h, * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c,
+       * libbfd-in.h, * libecoff.h, * mach-o-target.c, * mmo.c,
+       * nlm-target.h, * oasys.c, * pef.c, * plugin.c, * ppcboot.c, * som.c,
+       * srec.c, * tekhex.c, * verilog.c, * versados.c, * vms-alpha.c,
+       * xsym.c: Don't define various link_hash_table_free defines, and
+       remove from bfd_target vars.  Temporarily reference some of the
+       target link_hash_table_free functions to avoid warnings.
+       * bfd-in2.h: Regenerate.
+       * libbfd.h: Regenerate.
+
 2014-06-13  Alan Modra  <amodra@gmail.com>
 
        * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c,
index 904a5bc291a92e621a18864420ce81a433778b28..6c65ad5166b3855865cd0e62e7cf55171512eca0 100644 (file)
@@ -464,7 +464,6 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED,
 #define aout_32_section_already_linked              _bfd_generic_section_already_linked
 #define aout_32_bfd_define_common_symbol            bfd_generic_define_common_symbol
 #define aout_32_bfd_link_hash_table_create          _bfd_generic_link_hash_table_create
-#define aout_32_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define aout_32_bfd_link_add_symbols               _bfd_generic_link_add_symbols
 #define aout_32_bfd_link_just_syms                 _bfd_generic_link_just_syms
 #define aout_32_bfd_copy_link_hash_symbol_type \
index 9786f42dccfd137cf4df7b133fbde43db48bf7ef..019c49c32ca9b074d1f736d16d610b3e501cbb33 100644 (file)
@@ -521,9 +521,6 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
 #ifndef MY_bfd_link_hash_table_create
 #define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
 #endif
-#ifndef MY_bfd_link_hash_table_free
-#define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
 #ifndef MY_bfd_link_add_symbols
 #define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
 #endif
index 680ef610c133a10cc225a178819a1245923fa5c9..444ca4bea09be3b6a06222fb2f588f045218ee89 100644 (file)
@@ -979,9 +979,6 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_bfd_link_hash_table_create
 #define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
 #endif
-#ifndef MY_bfd_link_hash_table_free
-#define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
 #ifndef MY_bfd_link_add_symbols
 #define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
 #endif
index 722cc2bbe0d1d93974dfe5b4ffda8a8230b894c1..07d94dfce2a6e30c06ecb181e8321e9e2a71a1d8 100644 (file)
@@ -6650,9 +6650,6 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
 #define bfd_link_hash_table_create(abfd) \
        BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
 
-#define bfd_link_hash_table_free(abfd, hash) \
-       BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
-
 #define bfd_link_add_symbols(abfd, info) \
        BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
 
@@ -7045,7 +7042,6 @@ typedef struct bfd_target
   NAME##_bfd_get_relocated_section_contents, \
   NAME##_bfd_relax_section, \
   NAME##_bfd_link_hash_table_create, \
-  NAME##_bfd_link_hash_table_free, \
   NAME##_bfd_link_add_symbols, \
   NAME##_bfd_link_just_syms, \
   NAME##_bfd_copy_link_hash_symbol_type, \
@@ -7072,9 +7068,6 @@ typedef struct bfd_target
   struct bfd_link_hash_table *
               (*_bfd_link_hash_table_create) (bfd *);
 
-  /* Release the memory associated with the linker hash table.  */
-  void        (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
-
   /* Add symbols from this object file into the hash table.  */
   bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
 
index 641486514cfd585e4d079c98eb6ee35ae89c391f..2406319db573ffb8f01df9d0679ab0143cb34a22 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1501,9 +1501,6 @@ DESCRIPTION
 .#define bfd_link_hash_table_create(abfd) \
 .      BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
 .
-.#define bfd_link_hash_table_free(abfd, hash) \
-.      BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
-.
 .#define bfd_link_add_symbols(abfd, info) \
 .      BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
 .
index 13825d205403266b273173a98adb380ecdfdf2cd..09bbeceb158b9766e9d36d418261310df60f6a24 100644 (file)
@@ -305,7 +305,6 @@ binary_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
 #define binary_section_already_linked             _bfd_generic_section_already_linked
 #define binary_bfd_define_common_symbol            bfd_generic_define_common_symbol
 #define binary_bfd_link_hash_table_create         _bfd_generic_link_hash_table_create
-#define binary_bfd_link_hash_table_free           _bfd_generic_link_hash_table_free
 #define binary_bfd_link_just_syms                 _bfd_generic_link_just_syms
 #define binary_bfd_copy_link_hash_symbol_type \
   _bfd_generic_copy_link_hash_symbol_type
index fddc77d075c278400b8f5ad4cc87233dd9a0a59e..b444f803c89e094e13e82955aacb26d5569d0286 100644 (file)
@@ -1377,7 +1377,6 @@ b_out_bfd_get_relocated_section_contents (bfd *output_bfd,
 #define aout_32_bfd_make_debug_symbol          _bfd_nosymbols_bfd_make_debug_symbol
 #define aout_32_close_and_cleanup              aout_32_bfd_free_cached_info
 #define b_out_bfd_link_hash_table_create       _bfd_generic_link_hash_table_create
-#define b_out_bfd_link_hash_table_free         _bfd_generic_link_hash_table_free
 #define b_out_bfd_link_add_symbols             _bfd_generic_link_add_symbols
 #define b_out_bfd_link_just_syms               _bfd_generic_link_just_syms
 #define b_out_bfd_copy_link_hash_symbol_type \
index eb3b05b08939c61d4beee474469ad5d91d5a2c73..a735e04b80ee5d223ead8a3a7c0cd4fe5ede3b15 100644 (file)
@@ -2738,7 +2738,6 @@ const bfd_target rs6000_xcoff64_vec =
     bfd_generic_get_relocated_section_contents,
     bfd_generic_relax_section,
     _bfd_xcoff_bfd_link_hash_table_create,
-    _bfd_generic_link_hash_table_free,
     _bfd_xcoff_bfd_link_add_symbols,
     _bfd_generic_link_just_syms,
     _bfd_generic_copy_link_hash_symbol_type,
@@ -2997,7 +2996,6 @@ const bfd_target rs6000_xcoff64_aix_vec =
     bfd_generic_get_relocated_section_contents,
     bfd_generic_relax_section,
     _bfd_xcoff_bfd_link_hash_table_create,
-    _bfd_generic_link_hash_table_free,
     _bfd_xcoff_bfd_link_add_symbols,
     _bfd_generic_link_just_syms,
     _bfd_generic_copy_link_hash_symbol_type,
index ba3cfa27699450583d7926b18eb49a05a1faedb9..89ca23466126878fb3388628bf04320d2cc2b1c3 100644 (file)
@@ -5355,10 +5355,6 @@ dummy_reloc16_extra_cases (bfd *abfd ATTRIBUTE_UNUSED,
 }
 #endif
 
-#ifndef coff_bfd_link_hash_table_free
-#define coff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
-
 /* If coff_relocate_section is defined, we can use the optimized COFF
    backend linker.  Otherwise we must continue to use the old linker.  */
 
index 58c8c73fe53f159349cdaa019dbb551670966818..4cc879ec32ac405cd1d7a2a58e2d481c7dc7d4a3 100644 (file)
@@ -4652,6 +4652,7 @@ elf32_mn10300_link_hash_table_create (bfd *abfd)
       free (ret);
       return NULL;
     }
+  (void) elf32_mn10300_link_hash_table_free;
   return & ret->root.root;
 }
 
@@ -5581,8 +5582,6 @@ mn10300_elf_mkobject (bfd *abfd)
                                mn10300_elf_get_relocated_section_contents
 #define bfd_elf32_bfd_link_hash_table_create \
                                elf32_mn10300_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
-                               elf32_mn10300_link_hash_table_free
 
 #ifndef elf_symbol_leading_char
 #define elf_symbol_leading_char '_'
index 556e66c70039e512a7fc15c3133f6ab17ed0cda7..6358b580ba5a337101fccf692a6706bc30eb4d42 100644 (file)
@@ -3573,6 +3573,7 @@ elf32_arm_link_hash_table_create (bfd *abfd)
       free (ret);
       return NULL;
     }
+  (void) elf32_arm_link_hash_table_free;
 
   return &ret->root.root;
 }
@@ -16105,7 +16106,6 @@ elf32_arm_get_synthetic_symtab (bfd *abfd,
 #define bfd_elf32_bfd_set_private_flags                elf32_arm_set_private_flags
 #define bfd_elf32_bfd_print_private_bfd_data   elf32_arm_print_private_bfd_data
 #define bfd_elf32_bfd_link_hash_table_create    elf32_arm_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free      elf32_arm_link_hash_table_free
 #define bfd_elf32_bfd_reloc_type_lookup                elf32_arm_reloc_type_lookup
 #define bfd_elf32_bfd_reloc_name_lookup                elf32_arm_reloc_name_lookup
 #define bfd_elf32_find_nearest_line            elf32_arm_find_nearest_line
index 02cb449e09f26b77d16769cc0122b5baa1d4841a..55953841ce739495bdb95d92262a8b427923ab79 100644 (file)
@@ -756,6 +756,7 @@ elf32_avr_link_hash_table_create (bfd *abfd)
   if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
                             sizeof (struct elf32_avr_stub_hash_entry)))
     return NULL;
+  (void) elf32_avr_link_hash_table_free;
 
   return &htab->etab.root;
 }
@@ -3249,7 +3250,6 @@ elf32_avr_build_stubs (struct bfd_link_info *info)
 #define TARGET_LITTLE_NAME     "elf32-avr"
 
 #define bfd_elf32_bfd_link_hash_table_create elf32_avr_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free   elf32_avr_link_hash_table_free
 
 #define elf_info_to_howto                   avr_info_to_howto_rela
 #define elf_info_to_howto_rel               NULL
index 3d5597672f4e5f3616783cbf51e10fe53f7a66d0..635ec42d94348cb10d4e981fdd9d30286eb83d48 100644 (file)
@@ -445,6 +445,7 @@ elf32_hppa_link_hash_table_create (bfd *abfd)
   if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
                            sizeof (struct elf32_hppa_stub_hash_entry)))
     return NULL;
+  (void) elf32_hppa_link_hash_table_free;
 
   htab->text_segment_base = (bfd_vma) -1;
   htab->data_segment_base = (bfd_vma) -1;
@@ -4625,7 +4626,6 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 /* Stuff for the BFD linker.  */
 #define bfd_elf32_bfd_final_link            elf32_hppa_final_link
 #define bfd_elf32_bfd_link_hash_table_create elf32_hppa_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free   elf32_hppa_link_hash_table_free
 #define elf_backend_adjust_dynamic_symbol    elf32_hppa_adjust_dynamic_symbol
 #define elf_backend_copy_indirect_symbol     elf32_hppa_copy_indirect_symbol
 #define elf_backend_check_relocs            elf32_hppa_check_relocs
index a42c2d26946dc3ba5e0ad0c11f8ccbd1a31e56f8..eb5b3d01be852367648e33241aa0ab586ef9fc47 100644 (file)
@@ -973,6 +973,7 @@ elf_i386_link_hash_table_create (bfd *abfd)
       free (ret);
       return NULL;
     }
+  (void) elf_i386_link_hash_table_free;
 
   return &ret->elf.root;
 }
@@ -5041,7 +5042,6 @@ elf_i386_add_symbol_hook (bfd * abfd,
 
 #define bfd_elf32_bfd_is_local_label_name     elf_i386_is_local_label_name
 #define bfd_elf32_bfd_link_hash_table_create  elf_i386_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free    elf_i386_link_hash_table_free
 #define bfd_elf32_bfd_reloc_type_lookup              elf_i386_reloc_type_lookup
 #define bfd_elf32_bfd_reloc_name_lookup              elf_i386_reloc_name_lookup
 
index 4b2c16e07e5f00ae9a01752a4aaaaf593271644e..2101bdf827fd564441854b8b62ff2703b062550e 100644 (file)
@@ -1305,8 +1305,6 @@ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] =
 
 #define bfd_elf32_bfd_link_hash_table_create \
                                 m68hc11_elf_bfd_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
-                               m68hc11_elf_bfd_link_hash_table_free
 #define bfd_elf32_bfd_merge_private_bfd_data \
                                        _bfd_m68hc11_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_set_private_flags        _bfd_m68hc11_elf_set_private_flags
index f643c37fe955d53bdd15dcdd9fb619ae7a523074..7f48b7eb761db9545f4ff1cd4f07f9773f9b6c45 100644 (file)
@@ -655,8 +655,6 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] =
 
 #define bfd_elf32_bfd_link_hash_table_create \
                                 m68hc12_elf_bfd_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
-                               m68hc11_elf_bfd_link_hash_table_free
 #define bfd_elf32_bfd_merge_private_bfd_data \
                                        _bfd_m68hc11_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_set_private_flags        _bfd_m68hc11_elf_set_private_flags
index 86252a85f617ffec9ce17c784973d1cb3c87c614..b857a0dfa8817d0596a1f3ab2ca2f69dfda50ce1 100644 (file)
@@ -977,6 +977,7 @@ elf_m68k_link_hash_table_create (bfd *abfd)
       free (ret);
       return NULL;
     }
+  (void) elf_m68k_link_hash_table_free;
 
   ret->multi_got_.global_symndx = 1;
 
@@ -4857,9 +4858,6 @@ elf_m68k_add_symbol_hook (bfd *abfd,
                                        _bfd_elf_create_dynamic_sections
 #define bfd_elf32_bfd_link_hash_table_create \
                                        elf_m68k_link_hash_table_create
-/* ??? Should it be this macro or bfd_elfNN_bfd_link_hash_table_create?  */
-#define bfd_elf32_bfd_link_hash_table_free \
-                                       elf_m68k_link_hash_table_free
 #define bfd_elf32_bfd_final_link       bfd_elf_final_link
 
 #define elf_backend_check_relocs       elf_m68k_check_relocs
index e1f800b6547e113c7eff4e4341e1c1d122712ba5..fde454b80e376941b57f079f9a77e5abe6d4ccb2 100644 (file)
@@ -1056,6 +1056,7 @@ elf_metag_link_hash_table_create (bfd *abfd)
   if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
                            sizeof (struct elf_metag_stub_hash_entry)))
     return NULL;
+  (void) elf_metag_link_hash_table_free;
 
   return &htab->etab.root;
 }
@@ -4295,7 +4296,6 @@ elf_metag_plt_sym_val (bfd_vma i, const asection *plt,
 #define bfd_elf32_bfd_is_local_label_name      elf_metag_is_local_label_name
 #define bfd_elf32_bfd_link_hash_table_create \
        elf_metag_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free     elf_metag_link_hash_table_free
 #define elf_backend_relocate_section           elf_metag_relocate_section
 #define elf_backend_gc_mark_hook               elf_metag_gc_mark_hook
 #define elf_backend_gc_sweep_hook              elf_metag_gc_sweep_hook
index 10060c252230858bc510ab6b23053121def1b877..ba6a3718323e33c581eda42eeb55be6b9890440b 100644 (file)
@@ -5140,6 +5140,7 @@ nios2_elf32_link_hash_table_create (bfd *abfd)
   if (!bfd_hash_table_init (&ret->bstab, stub_hash_newfunc,
                            sizeof (struct elf32_nios2_stub_hash_entry)))
     return NULL;
+  (void) nios2_elf32_link_hash_table_free;
 
   return &ret->root.root;
 }
@@ -5250,8 +5251,6 @@ const struct bfd_elf_special_section elf32_nios2_special_sections[] =
 
 #define bfd_elf32_bfd_link_hash_table_create \
                                          nios2_elf32_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
-                                         nios2_elf32_link_hash_table_free
 
 /* Relocation table lookup macros.  */
 
index f714a5e4c8e03bccc0f47a9738525ecf765744dc..ecfa16509aed8d3f039358b984ec0f78348c5204 100644 (file)
@@ -209,8 +209,6 @@ elf32_sparc_add_symbol_hook (bfd * abfd,
   _bfd_sparc_elf_reloc_name_lookup
 #define bfd_elf32_bfd_link_hash_table_create \
                                        _bfd_sparc_elf_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
-                                       _bfd_sparc_elf_link_hash_table_free
 #define bfd_elf32_bfd_relax_section    _bfd_sparc_elf_relax_section
 #define bfd_elf32_new_section_hook     _bfd_sparc_elf_new_section_hook
 #define elf_backend_copy_indirect_symbol \
index 87d06c874d2a05c24a68b4047fd4c4f327819be5..588901bab11c7373cf1613b1d8b0f390e247c617 100644 (file)
@@ -717,7 +717,6 @@ elf32_xgate_post_process_headers (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_in
 #define elf_backend_add_symbol_hook          elf32_xgate_add_symbol_hook
 
 #define bfd_elf32_bfd_link_hash_table_create xgate_elf_bfd_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free   xgate_elf_bfd_link_hash_table_free
 #define bfd_elf32_bfd_merge_private_bfd_data _bfd_xgate_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_set_private_flags      _bfd_xgate_elf_set_private_flags
 #define bfd_elf32_bfd_print_private_bfd_data _bfd_xgate_elf_print_private_bfd_data
index 989646b00e2d909e28605355692c107387976467..4beeca204badb47d71d5a6cacf4033440d019551 100644 (file)
@@ -1070,6 +1070,7 @@ elf64_ia64_hash_table_create (bfd *abfd)
       free (ret);
       return NULL;
     }
+  (void) elf64_ia64_link_hash_table_free;
 
   return &ret->root.root;
 }
@@ -5458,8 +5459,6 @@ static const struct elf_size_info elf64_ia64_vms_size_info = {
 /* Stuff for the BFD linker: */
 #define bfd_elf64_bfd_link_hash_table_create \
        elf64_ia64_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free \
-       elf64_ia64_link_hash_table_free
 #define elf_backend_create_dynamic_sections \
        elf64_ia64_create_dynamic_sections
 #define elf_backend_check_relocs \
index 29d2b77340737576af2511a43b4a06c65d709b21..581ce55f309b3b06df1f5a33d64631b0167f1f76 100644 (file)
@@ -84,7 +84,6 @@ static bfd_vma opd_entry_value
 #define bfd_elf64_bfd_print_private_bfd_data  ppc64_elf_print_private_bfd_data
 #define bfd_elf64_new_section_hook           ppc64_elf_new_section_hook
 #define bfd_elf64_bfd_link_hash_table_create  ppc64_elf_link_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free    ppc64_elf_link_hash_table_free
 #define bfd_elf64_get_synthetic_symtab       ppc64_elf_get_synthetic_symtab
 #define bfd_elf64_bfd_link_just_syms         ppc64_elf_link_just_syms
 
@@ -4204,6 +4203,7 @@ ppc64_elf_link_hash_table_create (bfd *abfd)
       _bfd_elf_link_hash_table_free ((struct bfd_link_hash_table *) htab);
       return NULL;
     }
+  (void) ppc64_elf_link_hash_table_free;
 
   /* Initializing two fields of the union is just cosmetic.  We really
      only care about glist, but when compiled on a 32-bit host the
index 6f995c5cfba7f03d00038952edeccf14f9890d3c..0866c0db1b0ee42bc9bac4cfb8fcbe9d30d79b46 100644 (file)
@@ -864,8 +864,6 @@ const struct elf_size_info elf64_sparc_size_info =
   _bfd_sparc_elf_plt_sym_val
 #define bfd_elf64_bfd_link_hash_table_create \
   _bfd_sparc_elf_link_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free \
-  _bfd_sparc_elf_link_hash_table_free
 #define elf_info_to_howto \
   _bfd_sparc_elf_info_to_howto
 #define elf_backend_copy_indirect_symbol \
index 306b4371d3450e8175fd7e0b0338fd641be75478..27f0a54fdbb7fe7a535a459b04011344b40269fb 100644 (file)
@@ -1030,6 +1030,7 @@ elf_x86_64_link_hash_table_create (bfd *abfd)
       free (ret);
       return NULL;
     }
+  (void) elf_x86_64_link_hash_table_free;
 
   return &ret->elf.root;
 }
@@ -5640,8 +5641,6 @@ static const struct bfd_elf_special_section
 
 #define bfd_elf64_bfd_link_hash_table_create \
   elf_x86_64_link_hash_table_create
-#define bfd_elf64_bfd_link_hash_table_free \
-  elf_x86_64_link_hash_table_free
 #define bfd_elf64_bfd_reloc_type_lookup            elf_x86_64_reloc_type_lookup
 #define bfd_elf64_bfd_reloc_name_lookup \
   elf_x86_64_reloc_name_lookup
@@ -5913,8 +5912,6 @@ elf32_x86_64_nacl_elf_object_p (bfd *abfd)
 
 #define bfd_elf32_bfd_link_hash_table_create \
   elf_x86_64_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free \
-  elf_x86_64_link_hash_table_free
 #define bfd_elf32_bfd_reloc_type_lookup        \
   elf_x86_64_reloc_type_lookup
 #define bfd_elf32_bfd_reloc_name_lookup \
index c1ca5947a1d04063d058a5d11c0114421bcfd6b2..4baa41b00c4263395ef60241012ea506fdb2e225 100644 (file)
@@ -2114,6 +2114,7 @@ elfNN_aarch64_link_hash_table_create (bfd *abfd)
       free (ret);
       return NULL;
     }
+  (void) elfNN_aarch64_link_hash_table_free;
 
   return &ret->root.root;
 }
@@ -7196,9 +7197,6 @@ const struct elf_size_info elfNN_aarch64_size_info =
 #define bfd_elfNN_bfd_link_hash_table_create    \
   elfNN_aarch64_link_hash_table_create
 
-#define bfd_elfNN_bfd_link_hash_table_free      \
-  elfNN_aarch64_link_hash_table_free
-
 #define bfd_elfNN_bfd_merge_private_bfd_data   \
   elfNN_aarch64_merge_private_bfd_data
 
index 7fcf489df833cfa8a87f4847a09678283e60b6b6..c87dd996efed3cf99bd07bde303511b6e1d1949a 100644 (file)
@@ -1461,6 +1461,7 @@ elfNN_ia64_hash_table_create (bfd *abfd)
       free (ret);
       return NULL;
     }
+  (void) elfNN_ia64_link_hash_table_free;
 
   return &ret->root.root;
 }
@@ -5024,8 +5025,6 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
 /* Stuff for the BFD linker: */
 #define bfd_elfNN_bfd_link_hash_table_create \
        elfNN_ia64_hash_table_create
-#define bfd_elfNN_bfd_link_hash_table_free \
-       elfNN_ia64_link_hash_table_free
 #define elf_backend_create_dynamic_sections \
        elfNN_ia64_create_dynamic_sections
 #define elf_backend_check_relocs \
index 1460d6a6109f6226ff91865869e8190671157dd1..b6531478e661c8dfa993302273cbaaf986f4f843 100644 (file)
 #ifndef bfd_elfNN_bfd_link_hash_table_create
 #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
 #endif
-#ifndef bfd_elfNN_bfd_link_hash_table_free
-#define bfd_elfNN_bfd_link_hash_table_free _bfd_elf_link_hash_table_free
-#endif
 #ifndef bfd_elfNN_bfd_link_add_symbols
 #define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols
 #endif
 #define bfd_elfNN_bfd_link_hash_table_create \
   _bfd_generic_link_hash_table_create
 #endif
-#ifndef bfd_elfNN_bfd_link_hash_table_free
-#define bfd_elfNN_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
 #ifndef bfd_elfNN_bfd_link_add_symbols
 #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #endif
index 7ec9298493c871148f31890784f1d11d195d917e..e16a66cc2d2493f0c7648312700f1c47489e6734 100644 (file)
@@ -150,7 +150,6 @@ msdos_set_section_contents (bfd *abfd,
   _bfd_generic_section_already_linked
 #define msdos_bfd_define_common_symbol bfd_generic_define_common_symbol
 #define msdos_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define msdos_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define msdos_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define msdos_bfd_link_just_syms _bfd_generic_link_just_syms
 #define msdos_bfd_copy_link_hash_symbol_type \
index 65ea0bc440028eb731511969cb64c4b8a23db7e6..0316263278ec25cff5f4f1da2788f6cdfa5aa33b 100644 (file)
@@ -174,7 +174,6 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
   _bfd_generic_section_already_linked
 #define os9k_bfd_define_common_symbol bfd_generic_define_common_symbol
 #define os9k_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define os9k_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define os9k_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define os9k_bfd_link_just_syms _bfd_generic_link_just_syms
 #define os9k_bfd_copy_link_hash_symbol_type \
index 7eb4dde86ee6e73cf484486caad2545132aa0145..a3d08bb819a770f1479261339dfb77c651f32bc0 100644 (file)
@@ -3779,7 +3779,6 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
   _bfd_generic_section_already_linked
 #define ieee_bfd_define_common_symbol bfd_generic_define_common_symbol
 #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define ieee_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define ieee_bfd_link_just_syms _bfd_generic_link_just_syms
 #define ieee_bfd_copy_link_hash_symbol_type \
@@ -3857,7 +3856,6 @@ const bfd_target ieee_vec =
 
   /* ieee_sizeof_headers, ieee_bfd_get_relocated_section_contents,
      ieee_bfd_relax_section, ieee_bfd_link_hash_table_create,
-     _bfd_generic_link_hash_table_free,
      ieee_bfd_link_add_symbols, ieee_bfd_final_link,
      ieee_bfd_link_split_section, ieee_bfd_gc_sections,
      ieee_bfd_merge_sections.  */
index f767cb0a3d3d4017d57acf26562149c0fd717d8f..3301f2f3aafb03a412afcd272a90c6623b5057d4 100644 (file)
@@ -936,7 +936,6 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
 #define ihex_section_already_linked               _bfd_generic_section_already_linked
 #define ihex_bfd_define_common_symbol             bfd_generic_define_common_symbol
 #define ihex_bfd_link_hash_table_create           _bfd_generic_link_hash_table_create
-#define ihex_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define ihex_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define ihex_bfd_link_just_syms                   _bfd_generic_link_just_syms
 #define ihex_bfd_copy_link_hash_symbol_type \
index 8a4f439ad0eccc798543a059321fe7e55eb69fab..c17e508289c24daac9a4dd126b9d7be0333f8cd5 100644 (file)
@@ -471,8 +471,6 @@ extern bfd_boolean _bfd_generic_set_section_contents
    bfd_false)
 #define _bfd_nolink_bfd_link_hash_table_create \
   ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr)
-#define _bfd_nolink_bfd_link_hash_table_free \
-  ((void (*) (struct bfd_link_hash_table *)) bfd_void)
 #define _bfd_nolink_bfd_link_add_symbols \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
 #define _bfd_nolink_bfd_link_just_syms \
index 09f307f8a05d77e731b03940cbc990da7f3eb2b0..923eb93d6739aa841361dfd37cdf6c764489f397 100644 (file)
@@ -476,8 +476,6 @@ extern bfd_boolean _bfd_generic_set_section_contents
    bfd_false)
 #define _bfd_nolink_bfd_link_hash_table_create \
   ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr)
-#define _bfd_nolink_bfd_link_hash_table_free \
-  ((void (*) (struct bfd_link_hash_table *)) bfd_void)
 #define _bfd_nolink_bfd_link_add_symbols \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
 #define _bfd_nolink_bfd_link_just_syms \
index f53d749d2c54e3735a5e08b645d2ad835a55bf11..97acea40e22cceea1516e69f57dbc78c3e83f76c 100644 (file)
@@ -311,7 +311,6 @@ extern int _bfd_ecoff_sizeof_headers (bfd *, struct bfd_link_info *);
 /* ecoff_bfd_relax_section defined by backend.  */
 extern struct bfd_link_hash_table *_bfd_ecoff_bfd_link_hash_table_create
   (bfd *);
-#define _bfd_ecoff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 extern bfd_boolean _bfd_ecoff_bfd_link_add_symbols
   (bfd *, struct bfd_link_info *);
 #define _bfd_ecoff_bfd_link_just_syms _bfd_generic_link_just_syms
index 36d0758f130f435be639ac7c665b81462894282b..a070e677ebdec6fd902e5c2a3edf3522a4e991d8 100644 (file)
@@ -37,7 +37,6 @@
 #define bfd_mach_o_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
 #define bfd_mach_o_bfd_relax_section                  bfd_generic_relax_section
 #define bfd_mach_o_bfd_link_hash_table_create         _bfd_generic_link_hash_table_create
-#define bfd_mach_o_bfd_link_hash_table_free           _bfd_generic_link_hash_table_free
 #define bfd_mach_o_bfd_link_add_symbols               _bfd_generic_link_add_symbols
 #define bfd_mach_o_bfd_link_just_syms                 _bfd_generic_link_just_syms
 #define bfd_mach_o_bfd_copy_link_hash_symbol_type \
index f8eeae5298fa17f33640db6f6735f3bcef252fd9..35d06f1d45276e1d27ac4443d6d534a31938e486 100644 (file)
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -3223,7 +3223,6 @@ mmo_write_object_contents (bfd *abfd)
 #define mmo_bfd_gc_sections bfd_generic_gc_sections
 #define mmo_bfd_lookup_section_flags bfd_generic_lookup_section_flags
 #define mmo_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define mmo_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define mmo_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define mmo_bfd_link_just_syms _bfd_generic_link_just_syms
 #define mmo_bfd_copy_link_hash_symbol_type \
index e55ddb6ed2720934ec9ff808c091685841b928f3..08fba07feb49110fd11670e171f8f9343aa856c9 100644 (file)
@@ -51,7 +51,6 @@
 #define nlm_section_already_linked              _bfd_generic_section_already_linked
 #define nlm_bfd_define_common_symbol            bfd_generic_define_common_symbol
 #define nlm_bfd_link_hash_table_create          _bfd_generic_link_hash_table_create
-#define nlm_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define nlm_bfd_link_add_symbols                _bfd_generic_link_add_symbols
 #define nlm_bfd_link_just_syms                  _bfd_generic_link_just_syms
 #define nlm_bfd_copy_link_hash_symbol_type \
index 74305d73c162fe1cd67cb80bc95a2f20a6e87302..b4a97fe4bdc70cd1b3bcab5dc442338b402830f1 100644 (file)
@@ -1204,7 +1204,6 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
 #define oasys_section_already_linked               _bfd_generic_section_already_linked
 #define oasys_bfd_define_common_symbol             bfd_generic_define_common_symbol
 #define oasys_bfd_link_hash_table_create           _bfd_generic_link_hash_table_create
-#define oasys_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define oasys_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define oasys_bfd_link_just_syms                   _bfd_generic_link_just_syms
 #define oasys_bfd_copy_link_hash_symbol_type \
index f0b323388f2050d46c2b2ebeb11aa69413f67a43..4faabb49d18fde5be17f73de1d1027710078d8bb 100644 (file)
--- a/bfd/pef.c
+++ b/bfd/pef.c
@@ -58,7 +58,6 @@
 #define bfd_pef_section_already_linked             _bfd_generic_section_already_linked
 #define bfd_pef_bfd_define_common_symbol            bfd_generic_define_common_symbol
 #define bfd_pef_bfd_link_hash_table_create          _bfd_generic_link_hash_table_create
-#define bfd_pef_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define bfd_pef_bfd_link_add_symbols                _bfd_generic_link_add_symbols
 #define bfd_pef_bfd_link_just_syms                  _bfd_generic_link_just_syms
 #define bfd_pef_bfd_copy_link_hash_symbol_type \
index c3f28ede0c0fca1c81884094e278da48c57abe0a..c9d53c89a61fbda9a5d9171e8c4d494a7f96c9cc 100644 (file)
@@ -92,7 +92,6 @@ dlerror (void)
 #define bfd_plugin_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
 #define bfd_plugin_bfd_relax_section                  bfd_generic_relax_section
 #define bfd_plugin_bfd_link_hash_table_create         _bfd_generic_link_hash_table_create
-#define bfd_plugin_bfd_link_hash_table_free           _bfd_generic_link_hash_table_free
 #define bfd_plugin_bfd_link_add_symbols               _bfd_generic_link_add_symbols
 #define bfd_plugin_bfd_link_just_syms                 _bfd_generic_link_just_syms
 #define bfd_plugin_bfd_final_link                     _bfd_generic_final_link
index 7b990797682f847d9e884465cba4966f2c4da9a6..4814a4b1ea852fb8754744c851f2e340437bdf81 100644 (file)
@@ -454,7 +454,6 @@ ppcboot_bfd_print_private_bfd_data (bfd *abfd, void * farg)
   _bfd_generic_section_already_linked
 #define ppcboot_bfd_define_common_symbol bfd_generic_define_common_symbol
 #define ppcboot_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define ppcboot_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define ppcboot_bfd_link_just_syms _bfd_generic_link_just_syms
 #define ppcboot_bfd_copy_link_hash_symbol_type \
index b6143ae5e35dfe045e6668fbde9a2641556cb5b7..87f3288a45ba4d54dbcfa7c4c617fe5c466483c7 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -6732,7 +6732,6 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
 #define som_bfd_get_relocated_section_contents  bfd_generic_get_relocated_section_contents
 #define som_bfd_relax_section                   bfd_generic_relax_section
 #define som_bfd_link_hash_table_create          _bfd_generic_link_hash_table_create
-#define som_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define som_bfd_link_add_symbols                _bfd_generic_link_add_symbols
 #define som_bfd_link_just_syms                  _bfd_generic_link_just_syms
 #define som_bfd_copy_link_hash_symbol_type \
index 1045d9918fe30d3a406fb89e67d041d27ac8f45e..f11e74a0295fafe7d0bf1b4cc2719e10b11bba7d 100644 (file)
@@ -1258,7 +1258,6 @@ srec_print_symbol (bfd *abfd,
 #define srec_section_already_linked               _bfd_generic_section_already_linked
 #define srec_bfd_define_common_symbol             bfd_generic_define_common_symbol
 #define srec_bfd_link_hash_table_create           _bfd_generic_link_hash_table_create
-#define srec_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define srec_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define srec_bfd_link_just_syms                   _bfd_generic_link_just_syms
 #define srec_bfd_copy_link_hash_symbol_type \
index be5d11a75d6ecb88d85b35cd1b91ba7e40832062..0860dc5bb28cffd773062f7c87840fb2d6d6d09b 100644 (file)
@@ -446,7 +446,6 @@ BFD_JUMP_TABLE macros.
 .  NAME##_bfd_get_relocated_section_contents, \
 .  NAME##_bfd_relax_section, \
 .  NAME##_bfd_link_hash_table_create, \
-.  NAME##_bfd_link_hash_table_free, \
 .  NAME##_bfd_link_add_symbols, \
 .  NAME##_bfd_link_just_syms, \
 .  NAME##_bfd_copy_link_hash_symbol_type, \
@@ -473,9 +472,6 @@ BFD_JUMP_TABLE macros.
 .  struct bfd_link_hash_table *
 .              (*_bfd_link_hash_table_create) (bfd *);
 .
-.  {* Release the memory associated with the linker hash table.  *}
-.  void        (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
-.
 .  {* Add symbols from this object file into the hash table.  *}
 .  bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
 .
index 7fcab936da26b22600800441355ae6399bce9b8b..e5f6547589b9f528ca8c6971c7fbd7a7e01f869e 100644 (file)
@@ -949,7 +949,6 @@ tekhex_print_symbol (bfd *abfd,
 #define tekhex_section_already_linked               _bfd_generic_section_already_linked
 #define tekhex_bfd_define_common_symbol             bfd_generic_define_common_symbol
 #define tekhex_bfd_link_hash_table_create           _bfd_generic_link_hash_table_create
-#define tekhex_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define tekhex_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define tekhex_bfd_link_just_syms                   _bfd_generic_link_just_syms
 #define tekhex_bfd_copy_link_hash_symbol_type \
index 276e7fc7564fcb8e59af126c3beda242a026a928..c1c5458f1256c392188c80062cf68245d86274fe 100644 (file)
@@ -311,7 +311,6 @@ verilog_mkobject (bfd *abfd)
 #define verilog_bfd_discard_group                    bfd_generic_discard_group
 #define verilog_section_already_linked               _bfd_generic_section_already_linked
 #define verilog_bfd_link_hash_table_create           _bfd_generic_link_hash_table_create
-#define verilog_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define verilog_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define verilog_bfd_link_just_syms                   _bfd_generic_link_just_syms
 #define verilog_bfd_final_link                       _bfd_generic_final_link
index 2d49458566a1568bc1971ce05bfd47713026ffce..b02f31ab2ab42df9d879927badadf9fecf019254 100644 (file)
@@ -812,7 +812,6 @@ versados_canonicalize_reloc (bfd *abfd,
 #define versados_section_already_linked               _bfd_generic_section_already_linked
 #define versados_bfd_define_common_symbol             bfd_generic_define_common_symbol
 #define versados_bfd_link_hash_table_create           _bfd_generic_link_hash_table_create
-#define versados_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define versados_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define versados_bfd_link_just_syms                   _bfd_generic_link_just_syms
 #define versados_bfd_copy_link_hash_symbol_type \
index 66a1999efe3960d8ddf5e1795defa48a59aa7e8d..f62d324630e75c621c7a7924629d8d1cafb67aea 100644 (file)
@@ -9239,7 +9239,6 @@ bfd_vms_get_data (bfd *abfd)
   _bfd_generic_section_already_linked
 
 #define alpha_vms_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define alpha_vms_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define alpha_vms_bfd_link_just_syms _bfd_generic_link_just_syms
 #define alpha_vms_bfd_copy_link_hash_symbol_type \
   _bfd_generic_copy_link_hash_symbol_type
index 194511373b621e182cd6cbd8f2612706c7246419..58b23198e080cbb955e390cdefdd2ea01f3d4acf 100644 (file)
@@ -50,7 +50,6 @@
 #define bfd_sym_section_already_linked              _bfd_generic_section_already_linked
 #define bfd_sym_bfd_define_common_symbol            bfd_generic_define_common_symbol
 #define bfd_sym_bfd_link_hash_table_create          _bfd_generic_link_hash_table_create
-#define bfd_sym_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define bfd_sym_bfd_link_add_symbols                _bfd_generic_link_add_symbols
 #define bfd_sym_bfd_link_just_syms                  _bfd_generic_link_just_syms
 #define bfd_sym_bfd_copy_link_hash_symbol_type \
index e1abf43b73329dd03c68fda2ed03bc4cd255942d..783c4bdeff8d748fa41a5181c964c077be53f714 100644 (file)
@@ -1,3 +1,10 @@
+2014-06-13  Alan Modra  <amodra@gmail.com>
+
+       PR 17047
+       * ldlang.c (output_bfd_hash_table_free_fn): Delete.
+       (open_output): Don't set it..
+       * ldmain.c (ld_cleanup): ..or call it.
+
 2014-06-13  Alan Modra  <amodra@gmail.com>
 
        * emultempl/cr16elf.em, * emultempl/elf32.em, * emultempl/genelf.em,
index add86dadbd736eb4b244027f3796c76225a81b2a..e7c96696993b3250eae6cc9ad6c5baac1713787f 100644 (file)
@@ -3072,9 +3072,6 @@ lang_get_output_target (void)
   return default_target;
 }
 
-/* Stashed function to free link_info.hash; see open_output.  */
-void (*output_bfd_hash_table_free_fn) (struct bfd_link_hash_table *);
-
 /* Open the output file.  */
 
 static void
@@ -3154,18 +3151,6 @@ open_output (const char *name)
   if (link_info.hash == NULL)
     einfo (_("%P%F: can not create hash table: %E\n"));
 
-  /* We want to please memory leak checkers by deleting link_info.hash.
-     We can't do it in lang_finish, as a bfd target may hold references to
-     symbols in this table and use them when their _bfd_write_contents
-     function is invoked, as part of bfd_close on the output_bfd.  But,
-     output_bfd is deallocated at bfd_close, so we can't refer to
-     output_bfd after that time, and dereferencing it is needed to call
-     "bfd_link_hash_table_free".  Smash this dependency deadlock and grab
-     the function pointer; arrange to call it on link_info.hash in
-     ld_cleanup.  */
-  output_bfd_hash_table_free_fn
-    = link_info.output_bfd->xvec->_bfd_link_hash_table_free;
-
   bfd_set_gp_size (link_info.output_bfd, g_switch_value);
 }
 
index d4be6f0e2ef62c1c9516f6a24a5eb6185934a6be..ea25afe4f444e1bea43d831d030452784c1738f2 100644 (file)
@@ -171,10 +171,6 @@ 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