Move some code around, in preparation for a followup patch.
* elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c,
* elf32-i386.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-metag.c,
* elf32-nios2.c, * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c,
* elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c, * xcofflink.c:
Move link_hash_table_free functions before their corresponding
link_hash_table_create functions.
+2014-06-13 Alan Modra <amodra@gmail.com>
+
+ * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c,
+ * elf32-i386.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-metag.c,
+ * elf32-nios2.c, * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c,
+ * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c, * xcofflink.c:
+ Move link_hash_table_free functions before their corresponding
+ link_hash_table_create functions.
+
2014-06-13 Alan Modra <amodra@gmail.com>
* bfd.c (struct bfd): Replace link_next with a union.
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
+/* Destroy an mn10300 ELF linker hash table. */
+
+static void
+elf32_mn10300_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct elf32_mn10300_link_hash_table *ret
+ = (struct elf32_mn10300_link_hash_table *) hash;
+
+ _bfd_elf_link_hash_table_free
+ ((struct bfd_link_hash_table *) ret->static_hash_table);
+ _bfd_elf_link_hash_table_free
+ ((struct bfd_link_hash_table *) ret);
+}
+
/* Create an mn10300 ELF linker hash table. */
static struct bfd_link_hash_table *
return & ret->root.root;
}
-/* Free an mn10300 ELF linker hash table. */
-
-static void
-elf32_mn10300_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf32_mn10300_link_hash_table *ret
- = (struct elf32_mn10300_link_hash_table *) hash;
-
- _bfd_elf_link_hash_table_free
- ((struct bfd_link_hash_table *) ret->static_hash_table);
- _bfd_elf_link_hash_table_free
- ((struct bfd_link_hash_table *) ret);
-}
-
static unsigned long
elf_mn10300_mach (flagword flags)
{
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
+/* Destroy an ARM elf linker hash table. */
+
+static void
+elf32_arm_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct elf32_arm_link_hash_table *ret
+ = (struct elf32_arm_link_hash_table *) hash;
+
+ bfd_hash_table_free (&ret->stub_hash_table);
+ _bfd_elf_link_hash_table_free (hash);
+}
+
/* Create an ARM elf linker hash table. */
static struct bfd_link_hash_table *
return &ret->root.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf32_arm_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf32_arm_link_hash_table *ret
- = (struct elf32_arm_link_hash_table *) hash;
-
- bfd_hash_table_free (&ret->stub_hash_table);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Determine what kind of NOPs are available. */
static bfd_boolean
#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_hash_table_free
+#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
return _bfd_elf_link_hash_newfunc (entry, table, string);
}
+/* Free the derived linker hash table. */
+
+static void
+elf32_avr_link_hash_table_free (struct bfd_link_hash_table *btab)
+{
+ struct elf32_avr_link_hash_table *htab
+ = (struct elf32_avr_link_hash_table *) btab;
+
+ /* Free the address mapping table. */
+ if (htab->amt_stub_offsets != NULL)
+ free (htab->amt_stub_offsets);
+ if (htab->amt_destination_addr != NULL)
+ free (htab->amt_destination_addr);
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (btab);
+}
+
/* Create the derived linker hash table. The AVR ELF port uses the derived
hash table to keep information specific to the AVR ELF linker (without
using static variables). */
return &htab->etab.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf32_avr_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
- struct elf32_avr_link_hash_table *htab
- = (struct elf32_avr_link_hash_table *) btab;
-
- /* Free the address mapping table. */
- if (htab->amt_stub_offsets != NULL)
- free (htab->amt_stub_offsets);
- if (htab->amt_destination_addr != NULL)
- free (htab->amt_destination_addr);
-
- bfd_hash_table_free (&htab->bstab);
- _bfd_elf_link_hash_table_free (btab);
-}
-
/* Calculates the effective distance of a pc relative jump/call. */
static int
return entry;
}
+/* Free the derived linker hash table. */
+
+static void
+elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *btab)
+{
+ struct elf32_hppa_link_hash_table *htab
+ = (struct elf32_hppa_link_hash_table *) btab;
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (btab);
+}
+
/* Create the derived linker hash table. The PA ELF port uses the derived
hash table to keep information specific to the PA ELF linker (without
using static variables). */
return &htab->etab.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
- struct elf32_hppa_link_hash_table *htab
- = (struct elf32_hppa_link_hash_table *) btab;
-
- bfd_hash_table_free (&htab->bstab);
- _bfd_elf_link_hash_table_free (btab);
-}
-
/* Build a name for an entry in the stub hash table. */
static char *
return &ret->elf;
}
+/* Destroy an i386 ELF linker hash table. */
+
+static void
+elf_i386_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct elf_i386_link_hash_table *htab
+ = (struct elf_i386_link_hash_table *) hash;
+
+ if (htab->loc_hash_table)
+ htab_delete (htab->loc_hash_table);
+ if (htab->loc_hash_memory)
+ objalloc_free ((struct objalloc *) htab->loc_hash_memory);
+ _bfd_elf_link_hash_table_free (hash);
+}
+
/* Create an i386 ELF linker hash table. */
static struct bfd_link_hash_table *
return &ret->elf.root;
}
-/* Destroy an i386 ELF linker hash table. */
-
-static void
-elf_i386_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf_i386_link_hash_table *htab
- = (struct elf_i386_link_hash_table *) hash;
-
- if (htab->loc_hash_table)
- htab_delete (htab->loc_hash_table);
- if (htab->loc_hash_memory)
- objalloc_free ((struct objalloc *) htab->loc_hash_memory);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and
.rel.bss sections in DYNOBJ, and set up shortcuts to them in our
hash table. */
};
+/* Destroy a 68HC11/68HC12 ELF linker hash table. */
+
+void
+m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct m68hc11_elf_link_hash_table *ret
+ = (struct m68hc11_elf_link_hash_table *) hash;
+
+ bfd_hash_table_free (ret->stub_hash_table);
+ free (ret->stub_hash_table);
+ _bfd_elf_link_hash_table_free (hash);
+}
+
/* Create a 68HC11/68HC12 ELF linker hash table. */
struct m68hc11_elf_link_hash_table*
return ret;
}
-/* Free the derived linker hash table. */
-
-void
-m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct m68hc11_elf_link_hash_table *ret
- = (struct m68hc11_elf_link_hash_table *) hash;
-
- bfd_hash_table_free (ret->stub_hash_table);
- free (ret->stub_hash_table);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Assorted hash table functions. */
/* Initialize an entry in the stub hash table. */
return ret;
}
+/* Destroy an m68k ELF linker hash table. */
+
+static void
+elf_m68k_link_hash_table_free (struct bfd_link_hash_table *_htab)
+{
+ struct elf_m68k_link_hash_table *htab;
+
+ htab = (struct elf_m68k_link_hash_table *) _htab;
+
+ if (htab->multi_got_.bfd2got != NULL)
+ {
+ htab_delete (htab->multi_got_.bfd2got);
+ htab->multi_got_.bfd2got = NULL;
+ }
+ _bfd_elf_link_hash_table_free (_htab);
+}
+
/* Create an m68k ELF linker hash table. */
static struct bfd_link_hash_table *
return &ret->root.root;
}
-/* Destruct local data. */
-
-static void
-elf_m68k_link_hash_table_free (struct bfd_link_hash_table *_htab)
-{
- struct elf_m68k_link_hash_table *htab;
-
- htab = (struct elf_m68k_link_hash_table *) _htab;
-
- if (htab->multi_got_.bfd2got != NULL)
- {
- htab_delete (htab->multi_got_.bfd2got);
- htab->multi_got_.bfd2got = NULL;
- }
- _bfd_elf_link_hash_table_free (_htab);
-}
-
/* Set the right machine number. */
static bfd_boolean
return entry;
}
+/* Free the derived linker hash table. */
+
+static void
+elf_metag_link_hash_table_free (struct bfd_link_hash_table *btab)
+{
+ struct elf_metag_link_hash_table *htab
+ = (struct elf_metag_link_hash_table *) btab;
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (btab);
+}
+
/* Create the derived linker hash table. The Meta ELF port uses the derived
hash table to keep information specific to the Meta ELF linker (without
using static variables). */
return &htab->etab.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf_metag_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
- struct elf_metag_link_hash_table *htab
- = (struct elf_metag_link_hash_table *) btab;
-
- bfd_hash_table_free (&htab->bstab);
- _bfd_elf_link_hash_table_free (btab);
-}
-
/* Section name for stubs is the associated section name plus this
string. */
#define STUB_SUFFIX ".stub"
return TRUE;
}
+/* Free the derived linker hash table. */
+static void
+nios2_elf32_link_hash_table_free (struct bfd_link_hash_table *btab)
+{
+ struct elf32_nios2_link_hash_table *htab
+ = (struct elf32_nios2_link_hash_table *) btab;
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (btab);
+}
+
/* Implement bfd_elf32_bfd_link_hash_table_create. */
static struct bfd_link_hash_table *
nios2_elf32_link_hash_table_create (bfd *abfd)
return &ret->root.root;
}
-/* Free the derived linker hash table. */
-static void
-nios2_elf32_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
- struct elf32_nios2_link_hash_table *htab
- = (struct elf32_nios2_link_hash_table *) btab;
-
- bfd_hash_table_free (&htab->bstab);
- _bfd_elf_link_hash_table_free (btab);
-}
-
/* Implement elf_backend_reloc_type_class. */
static enum elf_reloc_type_class
nios2_elf32_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
return entry1->id == entry2->id && entry1->r_sym == entry2->r_sym;
}
-/* Create the derived linker hash table. The IA-64 ELF port uses this
- derived hash table to keep information specific to the IA-64 ElF
- linker (without using static variables). */
-
-static struct bfd_link_hash_table *
-elf64_ia64_hash_table_create (bfd *abfd)
-{
- struct elf64_ia64_link_hash_table *ret;
-
- ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
- if (!ret)
- return NULL;
-
- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- elf64_ia64_new_elf_hash_entry,
- sizeof (struct elf64_ia64_link_hash_entry),
- IA64_ELF_DATA))
- {
- free (ret);
- return NULL;
- }
-
- ret->loc_hash_table = htab_try_create (1024, elf64_ia64_local_htab_hash,
- elf64_ia64_local_htab_eq, NULL);
- ret->loc_hash_memory = objalloc_create ();
- if (!ret->loc_hash_table || !ret->loc_hash_memory)
- {
- free (ret);
- return NULL;
- }
-
- return &ret->root.root;
-}
-
/* Free the global elf64_ia64_dyn_sym_info array. */
static bfd_boolean
/* Destroy IA-64 linker hash table. */
static void
-elf64_ia64_hash_table_free (struct bfd_link_hash_table *hash)
+elf64_ia64_link_hash_table_free (struct bfd_link_hash_table *hash)
{
struct elf64_ia64_link_hash_table *ia64_info
= (struct elf64_ia64_link_hash_table *) hash;
_bfd_elf_link_hash_table_free (hash);
}
+/* Create the derived linker hash table. The IA-64 ELF port uses this
+ derived hash table to keep information specific to the IA-64 ElF
+ linker (without using static variables). */
+
+static struct bfd_link_hash_table *
+elf64_ia64_hash_table_create (bfd *abfd)
+{
+ struct elf64_ia64_link_hash_table *ret;
+
+ ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
+ if (!ret)
+ return NULL;
+
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ elf64_ia64_new_elf_hash_entry,
+ sizeof (struct elf64_ia64_link_hash_entry),
+ IA64_ELF_DATA))
+ {
+ free (ret);
+ return NULL;
+ }
+
+ ret->loc_hash_table = htab_try_create (1024, elf64_ia64_local_htab_hash,
+ elf64_ia64_local_htab_eq, NULL);
+ ret->loc_hash_memory = objalloc_create ();
+ if (!ret->loc_hash_table || !ret->loc_hash_memory)
+ {
+ free (ret);
+ return NULL;
+ }
+
+ return &ret->root.root;
+}
+
/* Traverse both local and global hash tables. */
struct elf64_ia64_dyn_sym_traverse_data
#define bfd_elf64_bfd_link_hash_table_create \
elf64_ia64_hash_table_create
#define bfd_elf64_bfd_link_hash_table_free \
- elf64_ia64_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 \
return e1->sec == e2->sec && e1->offset == e2->offset;
}
+/* Destroy a ppc64 ELF linker hash table. */
+
+static void
+ppc64_elf_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct ppc_link_hash_table *htab = (struct ppc_link_hash_table *) hash;
+
+ bfd_hash_table_free (&htab->stub_hash_table);
+ bfd_hash_table_free (&htab->branch_hash_table);
+ if (htab->tocsave_htab)
+ htab_delete (htab->tocsave_htab);
+ _bfd_elf_link_hash_table_free (hash);
+}
+
/* Create a ppc64 ELF linker hash table. */
static struct bfd_link_hash_table *
return &htab->elf.root;
}
-/* Free the derived linker hash table. */
-
-static void
-ppc64_elf_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct ppc_link_hash_table *htab = (struct ppc_link_hash_table *) hash;
-
- bfd_hash_table_free (&htab->stub_hash_table);
- bfd_hash_table_free (&htab->branch_hash_table);
- if (htab->tocsave_htab)
- htab_delete (htab->tocsave_htab);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Create sections for linker generated code. */
static bfd_boolean
return &ret->elf;
}
+/* Destroy an X86-64 ELF linker hash table. */
+
+static void
+elf_x86_64_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct elf_x86_64_link_hash_table *htab
+ = (struct elf_x86_64_link_hash_table *) hash;
+
+ if (htab->loc_hash_table)
+ htab_delete (htab->loc_hash_table);
+ if (htab->loc_hash_memory)
+ objalloc_free ((struct objalloc *) htab->loc_hash_memory);
+ _bfd_elf_link_hash_table_free (hash);
+}
+
/* Create an X86-64 ELF linker hash table. */
static struct bfd_link_hash_table *
return &ret->elf.root;
}
-/* Destroy an X86-64 ELF linker hash table. */
-
-static void
-elf_x86_64_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf_x86_64_link_hash_table *htab
- = (struct elf_x86_64_link_hash_table *) hash;
-
- if (htab->loc_hash_table)
- htab_delete (htab->loc_hash_table);
- if (htab->loc_hash_memory)
- objalloc_free ((struct objalloc *) htab->loc_hash_memory);
- _bfd_elf_link_hash_table_free (hash);
-}
-
/* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and
.rela.bss sections in DYNOBJ, and set up shortcuts to them in our
hash table. */
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
}
+/* Destroy an AArch64 elf linker hash table. */
+
+static void
+elfNN_aarch64_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct elf_aarch64_link_hash_table *ret
+ = (struct elf_aarch64_link_hash_table *) hash;
+
+ if (ret->loc_hash_table)
+ htab_delete (ret->loc_hash_table);
+ if (ret->loc_hash_memory)
+ objalloc_free ((struct objalloc *) ret->loc_hash_memory);
+
+ bfd_hash_table_free (&ret->stub_hash_table);
+ _bfd_elf_link_hash_table_free (hash);
+}
+
/* Create an AArch64 elf linker hash table. */
static struct bfd_link_hash_table *
return &ret->root.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elfNN_aarch64_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct elf_aarch64_link_hash_table *ret
- = (struct elf_aarch64_link_hash_table *) hash;
-
- if (ret->loc_hash_table)
- htab_delete (ret->loc_hash_table);
- if (ret->loc_hash_memory)
- objalloc_free ((struct objalloc *) ret->loc_hash_memory);
-
- bfd_hash_table_free (&ret->stub_hash_table);
- _bfd_elf_link_hash_table_free (hash);
-}
-
static bfd_boolean
aarch64_relocate (unsigned int r_type, bfd *input_bfd, asection *input_section,
bfd_vma offset, bfd_vma value)
elfNN_aarch64_link_hash_table_create
#define bfd_elfNN_bfd_link_hash_table_free \
- elfNN_aarch64_hash_table_free
+ elfNN_aarch64_link_hash_table_free
#define bfd_elfNN_bfd_merge_private_bfd_data \
elfNN_aarch64_merge_private_bfd_data
return entry1->id == entry2->id && entry1->r_sym == entry2->r_sym;
}
-/* Create the derived linker hash table. The IA-64 ELF port uses this
- derived hash table to keep information specific to the IA-64 ElF
- linker (without using static variables). */
-
-static struct bfd_link_hash_table *
-elfNN_ia64_hash_table_create (bfd *abfd)
-{
- struct elfNN_ia64_link_hash_table *ret;
-
- ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
- if (!ret)
- return NULL;
-
- if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- elfNN_ia64_new_elf_hash_entry,
- sizeof (struct elfNN_ia64_link_hash_entry),
- IA64_ELF_DATA))
- {
- free (ret);
- return NULL;
- }
-
- ret->loc_hash_table = htab_try_create (1024, elfNN_ia64_local_htab_hash,
- elfNN_ia64_local_htab_eq, NULL);
- ret->loc_hash_memory = objalloc_create ();
- if (!ret->loc_hash_table || !ret->loc_hash_memory)
- {
- free (ret);
- return NULL;
- }
-
- return &ret->root.root;
-}
-
/* Free the global elfNN_ia64_dyn_sym_info array. */
static bfd_boolean
/* Destroy IA-64 linker hash table. */
static void
-elfNN_ia64_hash_table_free (struct bfd_link_hash_table *hash)
+elfNN_ia64_link_hash_table_free (struct bfd_link_hash_table *hash)
{
struct elfNN_ia64_link_hash_table *ia64_info
= (struct elfNN_ia64_link_hash_table *) hash;
_bfd_elf_link_hash_table_free (hash);
}
+/* Create the derived linker hash table. The IA-64 ELF port uses this
+ derived hash table to keep information specific to the IA-64 ElF
+ linker (without using static variables). */
+
+static struct bfd_link_hash_table *
+elfNN_ia64_hash_table_create (bfd *abfd)
+{
+ struct elfNN_ia64_link_hash_table *ret;
+
+ ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret));
+ if (!ret)
+ return NULL;
+
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ elfNN_ia64_new_elf_hash_entry,
+ sizeof (struct elfNN_ia64_link_hash_entry),
+ IA64_ELF_DATA))
+ {
+ free (ret);
+ return NULL;
+ }
+
+ ret->loc_hash_table = htab_try_create (1024, elfNN_ia64_local_htab_hash,
+ elfNN_ia64_local_htab_eq, NULL);
+ ret->loc_hash_memory = objalloc_create ();
+ if (!ret->loc_hash_table || !ret->loc_hash_memory)
+ {
+ free (ret);
+ return NULL;
+ }
+
+ return &ret->root.root;
+}
+
/* Traverse both local and global hash tables. */
struct elfNN_ia64_dyn_sym_traverse_data
#define bfd_elfNN_bfd_link_hash_table_create \
elfNN_ia64_hash_table_create
#define bfd_elfNN_bfd_link_hash_table_free \
- elfNN_ia64_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 \
return &ret->elf;
}
+/* Destroy a SPARC ELF linker hash table. */
+
+void
+_bfd_sparc_elf_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct _bfd_sparc_elf_link_hash_table *htab
+ = (struct _bfd_sparc_elf_link_hash_table *) hash;
+
+ if (htab->loc_hash_table)
+ htab_delete (htab->loc_hash_table);
+ if (htab->loc_hash_memory)
+ objalloc_free ((struct objalloc *) htab->loc_hash_memory);
+ _bfd_generic_link_hash_table_free (hash);
+}
+
/* Create a SPARC ELF linker hash table. */
struct bfd_link_hash_table *
return &ret->elf.root;
}
-/* Destroy a SPARC ELF linker hash table. */
-
-void
-_bfd_sparc_elf_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct _bfd_sparc_elf_link_hash_table *htab
- = (struct _bfd_sparc_elf_link_hash_table *) hash;
-
- if (htab->loc_hash_table)
- htab_delete (htab->loc_hash_table);
- if (htab->loc_hash_memory)
- objalloc_free ((struct objalloc *) htab->loc_hash_memory);
- _bfd_generic_link_hash_table_free (hash);
-}
-
/* Create .plt, .rela.plt, .got, .rela.got, .dynbss, and
.rela.bss sections in DYNOBJ, and set up shortcuts to them in our
hash table. */
return (struct bfd_hash_entry *) ret;
}
-/* Create a XCOFF link hash table. */
+/* Destroy an XCOFF link hash table. */
+
+void
+_bfd_xcoff_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
+{
+ struct xcoff_link_hash_table *ret = (struct xcoff_link_hash_table *) hash;
+
+ _bfd_stringtab_free (ret->debug_strtab);
+ bfd_hash_table_free (&ret->root.table);
+ free (ret);
+}
+
+/* Create an XCOFF link hash table. */
struct bfd_link_hash_table *
_bfd_xcoff_bfd_link_hash_table_create (bfd *abfd)
return &ret->root;
}
-
-/* Free a XCOFF link hash table. */
-
-void
-_bfd_xcoff_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
-{
- struct xcoff_link_hash_table *ret = (struct xcoff_link_hash_table *) hash;
-
- _bfd_stringtab_free (ret->debug_strtab);
- bfd_hash_table_free (&ret->root.table);
- free (ret);
-}
\f
/* Read internal relocs for an XCOFF csect. This is a wrapper around
_bfd_coff_read_internal_relocs which tries to take advantage of any