mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-09 17:02:22 +08:00
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.
This commit is contained in:
28
bfd/opncls.c
28
bfd/opncls.c
@ -115,11 +115,35 @@ _bfd_new_bfd_contained_in (bfd *obfd)
|
||||
void
|
||||
_bfd_delete_bfd (bfd *abfd)
|
||||
{
|
||||
bfd_hash_table_free (&abfd->section_htab);
|
||||
objalloc_free ((struct objalloc *) abfd->memory);
|
||||
if (abfd->memory)
|
||||
{
|
||||
bfd_hash_table_free (&abfd->section_htab);
|
||||
objalloc_free ((struct objalloc *) abfd->memory);
|
||||
}
|
||||
free (abfd);
|
||||
}
|
||||
|
||||
/* Free objalloc memory. */
|
||||
|
||||
bfd_boolean
|
||||
_bfd_free_cached_info (bfd *abfd)
|
||||
{
|
||||
if (abfd->memory)
|
||||
{
|
||||
bfd_hash_table_free (&abfd->section_htab);
|
||||
objalloc_free ((struct objalloc *) abfd->memory);
|
||||
|
||||
abfd->sections = NULL;
|
||||
abfd->section_last = NULL;
|
||||
abfd->outsymbols = NULL;
|
||||
abfd->tdata.any = NULL;
|
||||
abfd->usrdata = NULL;
|
||||
abfd->memory = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
SECTION
|
||||
Opening and closing BFDs
|
||||
|
Reference in New Issue
Block a user