aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-avr.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-06-13 19:11:19 +0930
committerAlan Modra <amodra@gmail.com>2014-06-13 19:11:19 +0930
commit68faa6378d757de1fdf29f7d27025c5eadd897ec (patch)
treed8328db037f37874cf6bbcbc9d099851c40b8668 /bfd/elf32-avr.c
parentc72f2fb2bb6a3e1850b081dbfce4040970fae8e6 (diff)
downloadgdb-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/elf32-avr.c')
-rw-r--r--bfd/elf32-avr.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index 60a2c7f..02cb449 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -711,6 +711,24 @@ elf32_avr_link_hash_newfunc (struct bfd_hash_entry * entry,
return _bfd_elf_link_hash_newfunc (entry, table, string);
}
+/* Free the derived linker hash table. */
+
+static void
+elf32_avr_link_hash_table_free (struct bfd_link_hash_table *btab)
+{
+ struct elf32_avr_link_hash_table *htab
+ = (struct elf32_avr_link_hash_table *) btab;
+
+ /* Free the address mapping table. */
+ if (htab->amt_stub_offsets != NULL)
+ free (htab->amt_stub_offsets);
+ if (htab->amt_destination_addr != NULL)
+ free (htab->amt_destination_addr);
+
+ bfd_hash_table_free (&htab->bstab);
+ _bfd_elf_link_hash_table_free (btab);
+}
+
/* Create the derived linker hash table. The AVR ELF port uses the derived
hash table to keep information specific to the AVR ELF linker (without
using static variables). */
@@ -742,24 +760,6 @@ elf32_avr_link_hash_table_create (bfd *abfd)
return &htab->etab.root;
}
-/* Free the derived linker hash table. */
-
-static void
-elf32_avr_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
- struct elf32_avr_link_hash_table *htab
- = (struct elf32_avr_link_hash_table *) btab;
-
- /* Free the address mapping table. */
- if (htab->amt_stub_offsets != NULL)
- free (htab->amt_stub_offsets);
- if (htab->amt_destination_addr != NULL)
- free (htab->amt_destination_addr);
-
- bfd_hash_table_free (&htab->bstab);
- _bfd_elf_link_hash_table_free (btab);
-}
-
/* Calculates the effective distance of a pc relative jump/call. */
static int