diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2006-04-25 17:46:15 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2006-04-25 17:46:15 +0000 |
commit | b25e3d8745c44ea273073a657682137b97a04d1e (patch) | |
tree | e0a160144965edf2892e57004a67d7b12d9d81de /bfd/elf32-arm.c | |
parent | 1946c96e94f55ec6ebb8dcfc2521f9dd31921f68 (diff) | |
download | gdb-b25e3d8745c44ea273073a657682137b97a04d1e.zip gdb-b25e3d8745c44ea273073a657682137b97a04d1e.tar.gz gdb-b25e3d8745c44ea273073a657682137b97a04d1e.tar.bz2 |
2006-04-25 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/2467
* elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd)
is NULL first.
* elf32-arm.c (elf32_arm_close_and_cleanup): Check if
abfd->sections is NULL.
(elf32_arm_bfd_free_cached_info): New.
(bfd_elf32_bfd_free_cached_info): Defined.
* elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it
to _bfd_free_cached_info.
* libbfd-in.h (_bfd_free_cached_info): New.
* libbfd: Regenerated.
* opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL.
(_bfd_free_cached_info): New.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index ca33121..bd3c4e3 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -7936,11 +7936,25 @@ unrecord_section_via_map_over_sections (bfd * abfd ATTRIBUTE_UNUSED, static bfd_boolean elf32_arm_close_and_cleanup (bfd * abfd) { - bfd_map_over_sections (abfd, unrecord_section_via_map_over_sections, NULL); + if (abfd->sections) + bfd_map_over_sections (abfd, + unrecord_section_via_map_over_sections, + NULL); return _bfd_elf_close_and_cleanup (abfd); } +static bfd_boolean +elf32_arm_bfd_free_cached_info (bfd * abfd) +{ + if (abfd->sections) + bfd_map_over_sections (abfd, + unrecord_section_via_map_over_sections, + NULL); + + return _bfd_free_cached_info (abfd); +} + /* Display STT_ARM_TFUNC symbols as functions. */ static void @@ -8100,6 +8114,7 @@ const struct elf_size_info elf32_arm_size_info = { #define bfd_elf32_new_section_hook elf32_arm_new_section_hook #define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol #define bfd_elf32_close_and_cleanup elf32_arm_close_and_cleanup +#define bfd_elf32_bfd_free_cached_info elf32_arm_bfd_free_cached_info #define bfd_elf32_bfd_final_link elf32_arm_bfd_final_link #define elf_backend_get_symbol_type elf32_arm_get_symbol_type |