/* BFD back-end for CISCO crash dumps.
- Copyright (C) 1994-2018 Free Software Foundation, Inc.
+ Copyright (C) 1994-2022 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* Examine the file for a crash info struct at the offset given by
CRASH_INFO_LOC. */
-static const bfd_target *
+static bfd_cleanup
cisco_core_file_validate (bfd *abfd, int crash_info_loc)
{
char buf[4];
unsigned int rambase;
sec_ptr asect;
struct stat statbuf;
- bfd_size_type amt;
+ size_t amt;
flagword flags;
if (bfd_seek (abfd, (file_ptr) crash_info_loc, SEEK_SET) != 0)
nread = statbuf.st_size - asect->filepos;
asect->size = (nread < 1024) ? nread : 1024;
- return abfd->xvec;
+ return _bfd_no_cleanup;
/* Get here if we have already started filling out the BFD
and there is an error of some kind. */
return NULL;
}
-static const bfd_target *
+static bfd_cleanup
cisco_core_file_p (bfd *abfd)
{
int *crash_info_locp;
- const bfd_target *target = NULL;
+ bfd_cleanup cleanup = NULL;
for (crash_info_locp = crash_info_locs;
- *crash_info_locp != -1 && target == NULL;
+ *crash_info_locp != -1 && cleanup == NULL;
crash_info_locp++)
{
- target = cisco_core_file_validate (abfd, *crash_info_locp);
+ cleanup = cisco_core_file_validate (abfd, *crash_info_locp);
}
- return (target);
+ return cleanup;
}
static char *
' ', /* ar_pad_char */
16, /* ar_max_namelen */
0, /* match priority. */
+ TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols. */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
0, /* match_priority */
+ TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols. */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */