aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-xgate.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-xgate.c')
-rw-r--r--bfd/elf32-xgate.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/bfd/elf32-xgate.c b/bfd/elf32-xgate.c
index 588901b..01f39fa 100644
--- a/bfd/elf32-xgate.c
+++ b/bfd/elf32-xgate.c
@@ -426,20 +426,20 @@ xgate_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
cache_ptr->howto = &elf_xgate_howto_table[r_type];
}
-/* Free the derived linker hash table. */
+/* Destroy an XGATE ELF linker hash table. */
-void
-xgate_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash)
+static void
+xgate_elf_bfd_link_hash_table_free (bfd *obfd)
{
struct xgate_elf_link_hash_table *ret =
- (struct xgate_elf_link_hash_table *) hash;
+ (struct xgate_elf_link_hash_table *) obfd->link.hash;
bfd_hash_table_free (ret->stub_hash_table);
free (ret->stub_hash_table);
- _bfd_elf_link_hash_table_free (hash);
+ _bfd_elf_link_hash_table_free (obfd);
}
-/* Create a XGATE ELF linker hash table. */
+/* Create an XGATE ELF linker hash table. */
static struct bfd_link_hash_table*
xgate_elf_bfd_link_hash_table_create (bfd *abfd)
@@ -464,7 +464,7 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd)
ret->stub_hash_table = (struct bfd_hash_table*) bfd_zmalloc (amt);
if (ret->stub_hash_table == NULL)
{
- free (ret);
+ _bfd_elf_link_hash_table_free (abfd);
return NULL;
}
@@ -472,9 +472,10 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd)
sizeof(struct elf32_xgate_stub_hash_entry)))
{
free (ret->stub_hash_table);
- free (ret);
+ _bfd_elf_link_hash_table_free (abfd);
return NULL;
}
+ ret->root.root.hash_table_free = xgate_elf_bfd_link_hash_table_free;
return &ret->root.root;
}