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/elfnn-ia64.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/elfnn-ia64.c')
-rw-r--r-- | bfd/elfnn-ia64.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c index d941cdd..7fcf489 100644 --- a/bfd/elfnn-ia64.c +++ b/bfd/elfnn-ia64.c @@ -1369,40 +1369,6 @@ elfNN_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 * -elfNN_ia64_hash_table_create (bfd *abfd) -{ - struct elfNN_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, - elfNN_ia64_new_elf_hash_entry, - sizeof (struct elfNN_ia64_link_hash_entry), - IA64_ELF_DATA)) - { - free (ret); - return NULL; - } - - ret->loc_hash_table = htab_try_create (1024, elfNN_ia64_local_htab_hash, - elfNN_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 elfNN_ia64_dyn_sym_info array. */ static bfd_boolean @@ -1448,7 +1414,7 @@ elfNN_ia64_local_dyn_info_free (void **slot, /* Destroy IA-64 linker hash table. */ static void -elfNN_ia64_hash_table_free (struct bfd_link_hash_table *hash) +elfNN_ia64_link_hash_table_free (struct bfd_link_hash_table *hash) { struct elfNN_ia64_link_hash_table *ia64_info = (struct elfNN_ia64_link_hash_table *) hash; @@ -1465,6 +1431,40 @@ elfNN_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 * +elfNN_ia64_hash_table_create (bfd *abfd) +{ + struct elfNN_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, + elfNN_ia64_new_elf_hash_entry, + sizeof (struct elfNN_ia64_link_hash_entry), + IA64_ELF_DATA)) + { + free (ret); + return NULL; + } + + ret->loc_hash_table = htab_try_create (1024, elfNN_ia64_local_htab_hash, + elfNN_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 elfNN_ia64_dyn_sym_traverse_data @@ -5025,7 +5025,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define bfd_elfNN_bfd_link_hash_table_create \ elfNN_ia64_hash_table_create #define bfd_elfNN_bfd_link_hash_table_free \ - elfNN_ia64_hash_table_free + elfNN_ia64_link_hash_table_free #define elf_backend_create_dynamic_sections \ elfNN_ia64_create_dynamic_sections #define elf_backend_check_relocs \ |