/* BFD back-end for HP/UX core files.
- Copyright 1993, 1994, 1996, 1998, 1999, 2001
+ Copyright 1993, 1994, 1996, 1998, 1999, 2001, 2002
Free Software Foundation, Inc.
Written by Stu Grossman, Cygnus Support.
Converted to back-end form by Ian Lance Taylor, Cygnus SUpport
core_header.len,
(int) &proc_info - (int) & proc_info.hw_regs,
2))
- return NULL;
+ goto fail;
}
else
{
core_header.len,
(int) &proc_info - (int) & proc_info.hw_regs,
2))
- return NULL;
+ goto fail;
}
/* We always make one of these sections, for every thread. */
sprintf (secname, ".reg/%d", core_kernel_thread_id (abfd));
core_header.len,
(int) &proc_info - (int) & proc_info.hw_regs,
2))
- return NULL;
+ goto fail;
}
core_signal (abfd) = proc_info.sig;
if (bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR) != 0)
if (!make_bfd_asection (abfd, ".data",
SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
core_header.len, core_header.addr, 2))
- return NULL;
+ goto fail;
bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR);
good_sections++;
unknown_sections++;
break;
- default: return 0; /*unrecognized core file type */
+ default:
+ goto fail; /*unrecognized core file type */
}
}
abfd->filename);
return abfd->xvec;
+
+ fail:
+ bfd_release (abfd, core_hdr (abfd));
+ core_hdr (abfd) = NULL;
+ bfd_section_list_clear (abfd);
+ return NULL;
}
static char *