aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-m10300.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf-m10300.c')
-rw-r--r--bfd/elf-m10300.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index a80060a..ce68a16 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -111,6 +111,8 @@ static struct bfd_hash_entry *elf32_mn10300_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
static struct bfd_link_hash_table *elf32_mn10300_link_hash_table_create
PARAMS ((bfd *));
+static void elf32_mn10300_link_hash_table_free
+ PARAMS ((struct bfd_link_hash_table *));
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
@@ -2969,37 +2971,52 @@ elf32_mn10300_link_hash_table_create (abfd)
struct elf32_mn10300_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf32_mn10300_link_hash_table);
- ret = (struct elf32_mn10300_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf32_mn10300_link_hash_table *) bfd_malloc (amt);
if (ret == (struct elf32_mn10300_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf32_mn10300_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
ret->flags = 0;
amt = sizeof (struct elf_link_hash_table);
ret->static_hash_table
- = (struct elf32_mn10300_link_hash_table *) bfd_alloc (abfd, amt);
+ = (struct elf32_mn10300_link_hash_table *) bfd_malloc (amt);
if (ret->static_hash_table == NULL)
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
if (! _bfd_elf_link_hash_table_init (&ret->static_hash_table->root, abfd,
elf32_mn10300_link_hash_newfunc))
{
- bfd_release (abfd, ret->static_hash_table);
- bfd_release (abfd, ret);
+ free (ret->static_hash_table);
+ free (ret);
return NULL;
}
return &ret->root.root;
}
+/* Free an mn10300 ELF linker hash table. */
+
+static void
+elf32_mn10300_link_hash_table_free (hash)
+ struct bfd_link_hash_table *hash;
+{
+ struct elf32_mn10300_link_hash_table *ret
+ = (struct elf32_mn10300_link_hash_table *) hash;
+
+ _bfd_generic_link_hash_table_free
+ ((struct bfd_link_hash_table *) ret->static_hash_table);
+ _bfd_generic_link_hash_table_free
+ ((struct bfd_link_hash_table *) ret);
+}
+
static unsigned long
elf_mn10300_mach (flags)
flagword flags;
@@ -3092,6 +3109,8 @@ _bfd_mn10300_elf_merge_private_bfd_data (ibfd, obfd)
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
#define elf_symbol_leading_char '_'