* 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.
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);
+}
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;
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);
}
(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;
(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;