diff options
author | Tristan Gingold <gingold@adacore.com> | 2011-12-13 14:02:17 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2011-12-13 14:02:17 +0000 |
commit | 19f74287d3041c71dbbe15e67ac2ac8f36b0055c (patch) | |
tree | 5f129a13a3b33dc5bc52f97475a810850a0d7b7e /bfd/elf.c | |
parent | 52b457f816d68e2e93cab9e82bf5d1e4be11b7b5 (diff) | |
download | gdb-19f74287d3041c71dbbe15e67ac2ac8f36b0055c.tar.gz |
2011-12-13 Shinichiro Hamaji <shinichiro.hamaji@gmail.com>
* dwarf2.c (bfd_dwarf2_cleanup_debug_info): Accept stash as an
argument like other functions to support formats other than ELF.
* elf-bfd.h (bfd_dwarf2_cleanup_debug_info): Move to bfd-in.h.
* elf.c (_bfd_elf_close_and_cleanup): Pass dwarf2_find_line_info
in tdata as a parameter.
* libbfd-in.h (bfd_dwarf2_cleanup_debug_info): Move from
elf-bfd.h.
* libbfd.h (bfd_dwarf2_cleanup_debug_info): Regenerate.
* mach-o-target.c (bfd_mach_o_close_and_cleanup): Remove the
fallback macro.
(bfd_mach_o_find_nearest_line): Likewise.
* mach-o.c (bfd_mach_o_find_nearest_line): Add the definition
which calls _bfd_dwarf2_find_nearest_line.
(bfd_mach_o_close_and_cleanup): Likewise.
* mach-o.h (mach_o_data_struct): Add dwarf2_find_line_info.
(bfd_mach_o_find_nearest_line): Add declaration.
(bfd_mach_o_close_and_cleanup): Add declaration.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bfd/elf.c b/bfd/elf.c index f1e4882530d..bafb3bbd80b 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -7698,11 +7698,12 @@ _bfd_elf_validate_reloc (bfd *abfd, arelent *areloc) bfd_boolean _bfd_elf_close_and_cleanup (bfd *abfd) { - if (bfd_get_format (abfd) == bfd_object) + struct elf_obj_tdata *tdata = elf_tdata (abfd); + if (bfd_get_format (abfd) == bfd_object && tdata != NULL) { - if (elf_tdata (abfd) != NULL && elf_shstrtab (abfd) != NULL) + if (elf_shstrtab (abfd) != NULL) _bfd_elf_strtab_free (elf_shstrtab (abfd)); - _bfd_dwarf2_cleanup_debug_info (abfd); + _bfd_dwarf2_cleanup_debug_info (abfd, &tdata->dwarf2_find_line_info); } return _bfd_generic_close_and_cleanup (abfd); |