diff options
author | Alan Modra <amodra@gmail.com> | 2014-06-13 19:11:19 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-06-13 19:11:19 +0930 |
commit | 68faa6378d757de1fdf29f7d27025c5eadd897ec (patch) | |
tree | d8328db037f37874cf6bbcbc9d099851c40b8668 /bfd/elf64-ia64-vms.c | |
parent | c72f2fb2bb6a3e1850b081dbfce4040970fae8e6 (diff) | |
download | gdb-68faa6378d757de1fdf29f7d27025c5eadd897ec.zip gdb-68faa6378d757de1fdf29f7d27025c5eadd897ec.tar.gz gdb-68faa6378d757de1fdf29f7d27025c5eadd897ec.tar.bz2 |
Move link_hash_table_free functions earlier
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.
Diffstat (limited to 'bfd/elf64-ia64-vms.c')
-rw-r--r-- | bfd/elf64-ia64-vms.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c index d14b909..989646b 100644 --- a/bfd/elf64-ia64-vms.c +++ b/bfd/elf64-ia64-vms.c @@ -975,40 +975,6 @@ elf64_ia64_local_htab_eq (const void *ptr1, const void *ptr2) 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 @@ -1057,7 +1023,7 @@ elf64_ia64_local_dyn_info_free (void **slot, /* 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; @@ -1074,6 +1040,40 @@ elf64_ia64_hash_table_free (struct bfd_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 @@ -5459,7 +5459,7 @@ static const struct elf_size_info elf64_ia64_vms_size_info = { #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 \ |