+
+void
+_bfd_dwarf2_cleanup_debug_info (bfd *abfd)
+{
+ struct comp_unit *each;
+ struct dwarf2_debug *stash;
+
+ if (abfd == NULL || elf_tdata (abfd) == NULL)
+ return;
+
+ stash = elf_tdata (abfd)->dwarf2_find_line_info;
+
+ if (stash == NULL)
+ return;
+
+ for (each = stash->all_comp_units; each; each = each->next_unit)
+ {
+ struct abbrev_info **abbrevs = each->abbrevs;
+ size_t i;
+
+ for (i = 0; i < ABBREV_HASH_SIZE; i++)
+ {
+ struct abbrev_info *abbrev = abbrevs[i];
+
+ while (abbrev)
+ {
+ free (abbrev->attrs);
+ abbrev = abbrev->next;
+ }
+ }
+
+ if (each->line_table)
+ {
+ free (each->line_table->dirs);
+ free (each->line_table->files);
+ }
+ }
+
+ free (stash->dwarf_abbrev_buffer);
+ free (stash->dwarf_line_buffer);
+ free (stash->dwarf_ranges_buffer);
+}