aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-m10300.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-04-04 19:53:38 +0000
committerDaniel Jacobowitz <drow@false.org>2002-04-04 19:53:38 +0000
commite2d34d7de2eb0bf5be827ffcf976ae5f9524e901 (patch)
tree363ad0815b9cec526a01003557b1bacd69f656a7 /bfd/elf-m10300.c
parentb22ad7a77634debda60fe2ba2b237104a1aa7211 (diff)
downloadgdb-e2d34d7de2eb0bf5be827ffcf976ae5f9524e901.zip
gdb-e2d34d7de2eb0bf5be827ffcf976ae5f9524e901.tar.gz
gdb-e2d34d7de2eb0bf5be827ffcf976ae5f9524e901.tar.bz2
2002-04-04 Daniel Jacobowitz <drow@mvista.com>
* aout-adobe.c (aout_32_bfd_link_hash_table_free): Define. * aout-target.h (MY_bfd_link_hash_table_free): Conditionally define. * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise. * bfd.c (bfd_link_hash_table_free): Define. * binary.c (binary_bfd_link_hash_table_free): Define. * bout.c (b_out_bfd_link_hash_table_free): Define. * coff-rs6000.c (rs6000coff_vec): Include _bfd_generic_link_hash_table_free. (pmac_xcoff_vec): Likewise. * coff64-rs6000.c (rs6000coff64_vec): Likewise. (aix5coff64_vec): Likewise. * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define. * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function. (bfd_elf32_bfd_link_hash_table_free): Define. * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function. (bfd_elf32_bfd_link_hash_table_free): Define. * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally define. * i386msdos.c (msdos_bfd_link_hash_table_free): Define. * i386os9k.c (os9k_bfd_link_hash_table_free): Define. * ieee.c (ieee_bfd_link_hash_table_free): Define. * ihex.c (ihex_bfd_link_hash_table_free): Define. * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define. (_bfd_generic_link_hash_table_free): Add prototype. * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype. * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define. * linker.c (_bfd_generic_link_hash_table_free): New function. * mmo.c (mmo_bfd_link_hash_table_free): Define. * nlm-target.h (nlm_bfd_link_hash_table_free): Define. * oasys.c (oasys_bfd_link_hash_table_free): Define. * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define. * som.c (som_bfd_link_hash_table_free): Define. * srec.c (srec_bfd_link_hash_table_free): Define. * tekhex.c (tekhex_bfd_link_hash_table_free): Define. * versados.c (versados_bfd_link_hash_table_free): Define. * vms.c (vms_bfd_link_hash_table_free): New function. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function. * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc instead of bfd_alloc. * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise. * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise. * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise. * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise. * elf.c (_bfd_elf_link_hash_table_create): Likewise. * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise. * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise. * elf32-i386.c (elf_i386_link_hash_table_create): Likewise. * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. * elf32-s390.c (elf_s390_link_hash_table_create): Likewise. * elf32-sh.c (sh_elf_link_hash_table_create): Likewise. * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise. * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. * elf64-s390.c (elf_s390_link_hash_table_create): Likewise. * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise. * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise. * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. * linker.c (_bfd_generic_link_hash_table_create): Likewise. * m68klinux.c (linux_link_hash_table_create): Likewise. * sparclinux.c (linux_link_hash_table_create): Likewise. * sunos.c (sunos_link_hash_table_create): Likewise. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise. * targets.c: Add _bfd_link_hash_table_free to xvec. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate.
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 '_'