Tidy dwarf1 cached section contents

	* dwarf1.c (_bfd_dwarf1_cleanup_debug_info): New function.
	* libbfd-in.h (_bfd_dwarf1_cleanup_debug_info): Declare.
	* elf.c (_bfd_elf_close_and_cleanup): Call it.
	* elf-bfd.h (struct elf_obj_tdata): Make dwarf1_find_line_info
	a void*.
	* libbfd.h: Regenerate.
diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c
index a80d19d..d7c50ea 100644
--- a/bfd/dwarf1.c
+++ b/bfd/dwarf1.c
@@ -593,3 +593,15 @@
 
   return false;
 }
+
+void
+_bfd_dwarf1_cleanup_debug_info (bfd *abfd ATTRIBUTE_UNUSED, void **pinfo)
+{
+  struct dwarf1_debug* stash = *pinfo;
+
+  if (stash == NULL)
+    return;
+
+  free (stash->debug_section);
+  free (stash->line_section);
+}
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index dff1982..2a64a1e 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2070,7 +2070,7 @@
   void *line_info;
 
   /* A place to stash dwarf1 info for this bfd.  */
-  struct dwarf1_debug *dwarf1_find_line_info;
+  void *dwarf1_find_line_info;
 
   /* A place to stash dwarf2 info for this bfd.  */
   void *dwarf2_find_line_info;
diff --git a/bfd/elf.c b/bfd/elf.c
index c9abc25..45e5364 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9592,6 +9592,7 @@
       if (elf_tdata (abfd)->o != NULL && elf_shstrtab (abfd) != NULL)
 	_bfd_elf_strtab_free (elf_shstrtab (abfd));
       _bfd_dwarf2_cleanup_debug_info (abfd, &tdata->dwarf2_find_line_info);
+      _bfd_dwarf1_cleanup_debug_info (abfd, &tdata->dwarf1_find_line_info);
       _bfd_stab_cleanup (abfd, &tdata->line_info);
     }
 
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index ff58421..1c9f34b 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -573,6 +573,10 @@
   (bfd *, asymbol **, asection *, bfd_vma,
    const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
 
+/* Clean up the data used to handle DWARF 1 debugging information. */
+extern void _bfd_dwarf1_cleanup_debug_info
+  (bfd *, void **) ATTRIBUTE_HIDDEN;
+
 struct dwarf_debug_section
 {
   const char * uncompressed_name;
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index fa6f2d7..d1dc7b9 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -579,6 +579,10 @@
   (bfd *, asymbol **, asection *, bfd_vma,
    const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
 
+/* Clean up the data used to handle DWARF 1 debugging information. */
+extern void _bfd_dwarf1_cleanup_debug_info
+  (bfd *, void **) ATTRIBUTE_HIDDEN;
+
 struct dwarf_debug_section
 {
   const char * uncompressed_name;