* 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.
+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.
+
2002-04-04 Alan Modra <amodra@bigpond.net.au>
* dep-in.sed: Cope with absolute paths.
/* BFD back-end for a.out.adobe binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+ 2002
Free Software Foundation, Inc.
Written by Cygnus Support. Based on bout.c.
#define aout_32_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define aout_32_bfd_link_split_section _bfd_generic_link_split_section
/* Define a target vector and some small routines for a variant of a.out.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#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
/* BFD back-end for TMS320C30 a.out binaries.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
#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
#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))
CONCAT2 (NAME,_bfd_get_relocated_section_contents), \
CONCAT2 (NAME,_bfd_relax_section), \
CONCAT2 (NAME,_bfd_link_hash_table_create), \
+CONCAT2 (NAME,_bfd_link_hash_table_free), \
CONCAT2 (NAME,_bfd_link_add_symbols), \
CONCAT2 (NAME,_bfd_final_link), \
CONCAT2 (NAME,_bfd_link_split_section), \
different information in this table. */
struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
+ /* Release the memory associated with the linker hash table. */
+ void (*_bfd_link_hash_table_free) PARAMS ((struct bfd_link_hash_table *));
+
/* Add symbols from this object file into the hash table. */
boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
.#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))
.
/* BFD back-end for binary objects.
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>
#define binary_bfd_gc_sections bfd_generic_gc_sections
#define binary_bfd_merge_sections bfd_generic_merge_sections
#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_add_symbols _bfd_generic_link_add_symbols
#define binary_bfd_final_link _bfd_generic_final_link
#define binary_bfd_link_split_section _bfd_generic_link_split_section
/* BFD back-end for Intel 960 b.out binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
#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_final_link _bfd_generic_final_link
#define b_out_bfd_link_split_section _bfd_generic_link_split_section
struct coff_arm_link_hash_table * ret;
bfd_size_type amt = sizeof (struct coff_arm_link_hash_table);
- ret = (struct coff_arm_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct coff_arm_link_hash_table *) bfd_malloc (amt);
if (ret == (struct coff_arm_link_hash_table *) NULL)
return NULL;
if (! _bfd_coff_link_hash_table_init
(& ret->root, abfd, _bfd_coff_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return (struct bfd_link_hash_table *) NULL;
}
/* BFD back-end for Hitachi H8/300 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
struct h8300_coff_link_hash_table *ret;
bfd_size_type amt = sizeof (struct h8300_coff_link_hash_table);
- ret = (struct h8300_coff_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct h8300_coff_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (!_bfd_link_hash_table_init (&ret->root.root, abfd,
_bfd_generic_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
/* BFD back-end for Motorola MCore COFF/PE
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
{
mcore_hash_table * ret;
- ret = (mcore_hash_table *) bfd_alloc (abfd, (bfd_size_type) sizeof (* ret));
+ ret = (mcore_hash_table *) bfd_malloc ((bfd_size_type) sizeof (* ret));
if (ret == (mcore_hash_table *) NULL)
return NULL;
if (! _bfd_coff_link_hash_table_init
(& ret->root, abfd, _bfd_coff_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return (struct bfd_link_hash_table *) NULL;
}
/* BFD back-end for PowerPC Microsoft Portable Executable files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
struct ppc_coff_link_hash_table *ret;
bfd_size_type amt = sizeof (struct ppc_coff_link_hash_table);
- ret = (struct ppc_coff_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct ppc_coff_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! ppc_coff_link_hash_table_init (ret, abfd,
ppc_coff_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return (struct bfd_link_hash_table *) NULL;
}
return &ret->root.root;
bfd_generic_get_relocated_section_contents,
bfd_generic_relax_section, /* _bfd_relax_section */
_bfd_xcoff_bfd_link_hash_table_create, /* _bfd_link_hash_table_create */
+ _bfd_generic_link_hash_table_free, /* _bfd_link_hash_table_free */
_bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */
_bfd_xcoff_bfd_final_link, /* _bfd_filnal_link */
_bfd_generic_link_split_section, /* _bfd_link_split_section */
bfd_generic_get_relocated_section_contents,
bfd_generic_relax_section, /* _bfd_relax_section */
_bfd_xcoff_bfd_link_hash_table_create, /* _bfd_link_hash_table_create */
+ _bfd_generic_link_hash_table_free, /* _bfd_link_hash_table_free */
_bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */
_bfd_xcoff_bfd_final_link, /* _bfd_filnal_link */
_bfd_generic_link_split_section, /* _bfd_link_split_section */
bfd_generic_get_relocated_section_contents,
bfd_generic_relax_section, /* _bfd_relax_section */
_bfd_xcoff_bfd_link_hash_table_create,/* _bfd_link_hash_table_create */
+ _bfd_generic_link_hash_table_free, /* _bfd_link_hash_table_free */
_bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */
_bfd_xcoff_bfd_final_link, /* _bfd_filnal_link */
_bfd_generic_link_split_section, /* _bfd_link_split_section */
bfd_generic_get_relocated_section_contents,
bfd_generic_relax_section, /* _bfd_relax_section */
_bfd_xcoff_bfd_link_hash_table_create,/* _bfd_link_hash_table_create */
+ _bfd_generic_link_hash_table_free, /* _bfd_link_hash_table_free */
_bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */
_bfd_xcoff_bfd_final_link, /* _bfd_filnal_link */
_bfd_generic_link_split_section, /* _bfd_link_split_section */
}
#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. */
#ifdef coff_relocate_section
struct coff_link_hash_table *ret;
bfd_size_type amt = sizeof (struct coff_link_hash_table);
- ret = (struct coff_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct coff_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! _bfd_coff_link_hash_table_init (ret, abfd,
_bfd_coff_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return (struct bfd_link_hash_table *) NULL;
}
return &ret->root;
struct ecoff_link_hash_table *ret;
bfd_size_type amt = sizeof (struct ecoff_link_hash_table);
- ret = (struct ecoff_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct ecoff_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! _bfd_link_hash_table_init (&ret->root, abfd,
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));
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;
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 '_'
struct elf_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_link_hash_table);
- ret = (struct elf_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf_link_hash_table *) bfd_malloc (amt);
if (ret == (struct elf_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (ret, abfd, _bfd_elf_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct elf32_arm_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf32_arm_link_hash_table);
- ret = (struct elf32_arm_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf32_arm_link_hash_table *) bfd_malloc (amt);
if (ret == (struct elf32_arm_link_hash_table *) NULL)
return NULL;
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
elf32_arm_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct elf_cris_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_cris_link_hash_table);
- ret = ((struct elf_cris_link_hash_table *) bfd_alloc (abfd, amt));
+ ret = ((struct elf_cris_link_hash_table *) bfd_malloc (amt));
if (ret == (struct elf_cris_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf_cris_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
static struct bfd_link_hash_table *elf32_hppa_link_hash_table_create
PARAMS ((bfd *));
+static void elf32_hppa_link_hash_table_free
+ PARAMS ((struct bfd_link_hash_table *));
+
/* Stub handling functions. */
static char *hppa_stub_name
PARAMS ((const asection *, const asection *,
struct elf32_hppa_link_hash_table *ret;
bfd_size_type amt = sizeof (*ret);
- ret = (struct elf32_hppa_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf32_hppa_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, hppa_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
return &ret->elf.root;
}
+/* Free the derived linker hash table. */
+
+static void
+elf32_hppa_link_hash_table_free (hash)
+ struct bfd_link_hash_table *hash;
+{
+ struct elf32_hppa_link_hash_table *ret
+ = (struct elf32_hppa_link_hash_table *) hash;
+
+ bfd_hash_table_free (&ret->stub_hash_table);
+ _bfd_generic_link_hash_table_free (hash);
+}
+
/* Build a name for an entry in the stub hash table. */
static char *
/* 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_add_symbol_hook elf32_hppa_add_symbol_hook
#define elf_backend_adjust_dynamic_symbol elf32_hppa_adjust_dynamic_symbol
#define elf_backend_copy_indirect_symbol elf32_hppa_copy_indirect_symbol
struct elf_i386_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_i386_link_hash_table);
- ret = (struct elf_i386_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf_i386_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct elf_m68k_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_m68k_link_hash_table);
- ret = (struct elf_m68k_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf_m68k_link_hash_table *) bfd_malloc (amt);
if (ret == (struct elf_m68k_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf_m68k_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct elf_s390_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_s390_link_hash_table);
- ret = (struct elf_s390_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf_s390_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct elf_sh_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_sh_link_hash_table);
- ret = (struct elf_sh_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf_sh_link_hash_table *) bfd_malloc (amt);
if (ret == (struct elf_sh_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
sh_elf_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct alpha_elf_link_hash_table *ret;
bfd_size_type amt = sizeof (struct alpha_elf_link_hash_table);
- ret = (struct alpha_elf_link_hash_table *) bfd_zalloc (abfd, amt);
+ ret = (struct alpha_elf_link_hash_table *) bfd_zmalloc (amt);
if (ret == (struct alpha_elf_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
elf64_alpha_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct ppc_link_hash_table *htab;
bfd_size_type amt = sizeof (struct ppc_link_hash_table);
- htab = (struct ppc_link_hash_table *) bfd_alloc (abfd, amt);
+ htab = (struct ppc_link_hash_table *) bfd_malloc (amt);
if (htab == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&htab->elf, abfd, link_hash_newfunc))
{
- bfd_release (abfd, htab);
+ free (htab);
return NULL;
}
struct elf_s390_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_s390_link_hash_table);
- ret = (struct elf_s390_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf_s390_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct elf_sh64_link_hash_table *ret;
ret = ((struct elf_sh64_link_hash_table *)
- bfd_alloc (abfd, sizeof (struct elf_sh64_link_hash_table)));
+ bfd_malloc (sizeof (struct elf_sh64_link_hash_table)));
if (ret == (struct elf_sh64_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
sh64_elf64_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
/* SPARC-specific support for 64-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
struct sparc64_elf_link_hash_table *ret;
bfd_size_type amt = sizeof (struct sparc64_elf_link_hash_table);
- ret = (struct sparc64_elf_link_hash_table *) bfd_zalloc (abfd, amt);
+ ret = (struct sparc64_elf_link_hash_table *) bfd_zmalloc (amt);
if (ret == (struct sparc64_elf_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
_bfd_elf_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct elf64_x86_64_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf64_x86_64_link_hash_table);
- ret = (struct elf64_x86_64_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct elf64_x86_64_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
struct mips_elf_link_hash_table *ret;
bfd_size_type amt = sizeof (struct mips_elf_link_hash_table);
- ret = (struct mips_elf_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct mips_elf_link_hash_table *) bfd_malloc (amt);
if (ret == (struct mips_elf_link_hash_table *) NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
mips_elf_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return NULL;
}
_bfd_elf_canonicalize_dynamic_reloc
#endif
+#ifndef bfd_elfNN_bfd_link_hash_table_free
+#define bfd_elfNN_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
+#endif
+
#ifdef elf_backend_relocate_section
#ifndef bfd_elfNN_bfd_link_hash_table_create
#define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
/* BFD back-end for MS-DOS executables.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002
Free Software Foundation, Inc.
Written by Bryan Ford of the University of Utah.
#define msdos_bfd_gc_sections bfd_generic_gc_sections
#define msdos_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define msdos_bfd_link_split_section _bfd_generic_link_split_section
/* BFD back-end for os9000 i386 binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
#define os9k_bfd_gc_sections bfd_generic_gc_sections
#define os9k_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define os9k_bfd_link_split_section _bfd_generic_link_split_section
#define ieee_bfd_gc_sections bfd_generic_gc_sections
#define ieee_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define ieee_bfd_link_split_section _bfd_generic_link_split_section
/* 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 */
#define ihex_bfd_gc_sections bfd_generic_gc_sections
#define ihex_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define ihex_bfd_link_split_section _bfd_generic_link_split_section
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
bfd_false)
#define _bfd_nolink_bfd_link_hash_table_create \
((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
+#define _bfd_nolink_bfd_link_hash_table_free \
+ ((void (*) PARAMS ((struct bfd_link_hash_table *))) bfd_void)
#define _bfd_nolink_bfd_link_add_symbols \
((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false)
#define _bfd_nolink_bfd_final_link \
extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
PARAMS ((bfd *));
+/* Generic link hash table destruction routine. */
+extern void _bfd_generic_link_hash_table_free
+ PARAMS ((struct bfd_link_hash_table *));
+
/* Generic add symbol routine. */
extern boolean _bfd_generic_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
bfd_false)
#define _bfd_nolink_bfd_link_hash_table_create \
((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
+#define _bfd_nolink_bfd_link_hash_table_free \
+ ((void (*) PARAMS ((struct bfd_link_hash_table *))) bfd_void)
#define _bfd_nolink_bfd_link_add_symbols \
((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false)
#define _bfd_nolink_bfd_final_link \
extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
PARAMS ((bfd *));
+/* Generic link hash table destruction routine. */
+extern void _bfd_generic_link_hash_table_free
+ PARAMS ((struct bfd_link_hash_table *));
+
/* Generic add symbol routine. */
extern boolean _bfd_generic_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
/* BFD COFF object file private structure.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
PARAMS ((bfd *, arelent **, asymbol **));
extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create
PARAMS ((bfd *));
+extern void _bfd_xcoff_bfd_link_hash_table_free
+ PARAMS ((struct bfd_link_hash_table *));
extern boolean _bfd_xcoff_bfd_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean _bfd_xcoff_bfd_final_link
/* BFD COFF object file private structure.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
PARAMS ((bfd *, arelent **, asymbol **));
extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create
PARAMS ((bfd *));
+extern void _bfd_xcoff_bfd_link_hash_table_free
+ PARAMS ((struct bfd_link_hash_table *));
extern boolean _bfd_xcoff_bfd_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean _bfd_xcoff_bfd_final_link
/* BFD ECOFF object file private structure.
- Copyright 1993, 1994, 1995, 1996, 1999, 2001
+ Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
/* ecoff_bfd_relax_section defined by backend. */
extern struct bfd_link_hash_table *_bfd_ecoff_bfd_link_hash_table_create
PARAMS ((bfd *));
+#define _bfd_ecoff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
extern boolean _bfd_ecoff_bfd_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean _bfd_ecoff_bfd_final_link
struct generic_link_hash_table *ret;
bfd_size_type amt = sizeof (struct generic_link_hash_table);
- ret = (struct generic_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct generic_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
return (struct bfd_link_hash_table *) NULL;
if (! _bfd_link_hash_table_init (&ret->root, abfd,
return &ret->root;
}
+void
+_bfd_generic_link_hash_table_free (hash)
+ struct bfd_link_hash_table *hash;
+{
+ struct generic_link_hash_table *ret
+ = (struct generic_link_hash_table *) hash;
+
+ bfd_hash_table_free (&ret->root.table);
+ free (ret);
+}
+
/* Grab the symbols for an object file when doing a generic link. We
store the symbols in the outsymbols field. We need to keep them
around for the entire link to ensure that we only read them once.
struct linux_link_hash_table *ret;
bfd_size_type amt = sizeof (struct linux_link_hash_table);
- ret = (struct linux_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct linux_link_hash_table *) bfd_malloc (amt);
if (ret == (struct linux_link_hash_table *) NULL)
{
bfd_set_error (bfd_error_no_memory);
bfd_generic_get_relocated_section_contents
#define mmo_bfd_gc_sections bfd_generic_gc_sections
#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_final_link _bfd_generic_final_link
#define mmo_bfd_link_split_section _bfd_generic_link_split_section
/* Target definitions for 32/64-bit NLM (NetWare Loadable Module)
- Copyright 1993, 1994, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define nlm_bfd_gc_sections bfd_generic_gc_sections
#define nlm_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define nlm_bfd_link_split_section _bfd_generic_link_split_section
/* BFD back-end for oasys objects.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support, <sac@cygnus.com>.
#define oasys_bfd_gc_sections bfd_generic_gc_sections
#define oasys_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define oasys_bfd_link_split_section _bfd_generic_link_split_section
#define ppcboot_bfd_gc_sections bfd_generic_gc_sections
#define ppcboot_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define ppcboot_bfd_link_split_section _bfd_generic_link_split_section
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_final_link _bfd_generic_final_link
struct linux_link_hash_table *ret;
bfd_size_type amt = sizeof (struct linux_link_hash_table);
- ret = (struct linux_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct linux_link_hash_table *) bfd_malloc (amt);
if (ret == (struct linux_link_hash_table *) NULL)
return (struct bfd_link_hash_table *) NULL;
if (! NAME(aout,link_hash_table_init) (&ret->root, abfd,
#define srec_bfd_gc_sections bfd_generic_gc_sections
#define srec_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define srec_bfd_link_split_section _bfd_generic_link_split_section
struct sunos_link_hash_table *ret;
bfd_size_type amt = sizeof (struct sunos_link_hash_table);
- ret = (struct sunos_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct sunos_link_hash_table *) bfd_malloc (amt);
if (ret == (struct sunos_link_hash_table *) NULL)
return (struct bfd_link_hash_table *) NULL;
if (! NAME(aout,link_hash_table_init) (&ret->root, abfd,
sunos_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return (struct bfd_link_hash_table *) NULL;
}
.CONCAT2 (NAME,_bfd_get_relocated_section_contents), \
.CONCAT2 (NAME,_bfd_relax_section), \
.CONCAT2 (NAME,_bfd_link_hash_table_create), \
+.CONCAT2 (NAME,_bfd_link_hash_table_free), \
.CONCAT2 (NAME,_bfd_link_add_symbols), \
.CONCAT2 (NAME,_bfd_final_link), \
.CONCAT2 (NAME,_bfd_link_split_section), \
. different information in this table. *}
. struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
.
+. {* Release the memory associated with the linker hash table. *}
+. void (*_bfd_link_hash_table_free) PARAMS ((struct bfd_link_hash_table *));
+.
. {* Add symbols from this object file into the hash table. *}
. boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
.
/* BFD backend for Extended Tektronix Hex Format objects.
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
#define tekhex_bfd_gc_sections bfd_generic_gc_sections
#define tekhex_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define tekhex_bfd_link_split_section _bfd_generic_link_split_section
#define versados_bfd_gc_sections bfd_generic_gc_sections
#define versados_bfd_merge_sections bfd_generic_merge_sections
#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_final_link _bfd_generic_final_link
#define versados_bfd_link_split_section _bfd_generic_link_split_section
PARAMS ((bfd *abfd, struct bfd_link_info *link_info));
static struct bfd_link_hash_table *vms_bfd_link_hash_table_create
PARAMS ((bfd *abfd));
+static void vms_bfd_link_hash_table_free
+ PARAMS ((struct bfd_link_hash_table *hash));
static boolean vms_bfd_link_add_symbols
PARAMS ((bfd *abfd, struct bfd_link_info *link_info));
static boolean vms_bfd_final_link
return 0;
}
+/* Free a linker hash table. */
+
+static void
+vms_bfd_link_hash_table_free (hash)
+ struct bfd_link_hash_table *hash ATTRIBUTE_UNUSED;
+{
+#if VMS_DEBUG
+ vms_debug (1, "vms_bfd_link_hash_table_free(%p)\n", abfd);
+#endif
+}
+
/* Add symbols from this object file into the hash table. */
static boolean
struct xcoff_link_hash_table *ret;
bfd_size_type amt = sizeof (struct xcoff_link_hash_table);
- ret = (struct xcoff_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct xcoff_link_hash_table *) bfd_malloc (amt);
if (ret == (struct xcoff_link_hash_table *) NULL)
return (struct bfd_link_hash_table *) NULL;
if (! _bfd_link_hash_table_init (&ret->root, abfd, xcoff_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return (struct bfd_link_hash_table *) NULL;
}
return &ret->root;
}
+/* Free a XCOFF link hash table. */
+
+void
+_bfd_xcoff_bfd_link_hash_table_free (hash)
+ 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