X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=bfd%2Fnetbsd-core.c;h=8cafba00bb2a5f652c344a9db72f7dcc175026dd;hb=6a6117ab0ffe18ea984abca84869eae799c1b346;hp=6bba177b821820ce4da3f26e448e55d7a568c4a9;hpb=117ed4f8d5a9691c0bc1200d5d797e5211688c84;p=binutils-gdb.git diff --git a/bfd/netbsd-core.c b/bfd/netbsd-core.c index 6bba177b821..8cafba00bb2 100644 --- a/bfd/netbsd-core.c +++ b/bfd/netbsd-core.c @@ -1,14 +1,12 @@ /* BFD back end for NetBSD style core files - Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1988-2023 Free Software Foundation, Inc. Written by Paul Kranenburg, EUR This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -18,12 +16,13 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "libbfd.h" -#include "libaout.h" /* BFD a.out internal data structures. */ +#include "libaout.h" /* BFD a.out internal data structures. */ #include #include @@ -43,6 +42,7 @@ #define SPARC64_WCOOKIE_OFFSET 832 #define netbsd_core_file_matches_executable_p generic_core_file_matches_executable_p +#define netbsd_core_file_pid _bfd_nocore_core_file_pid struct netbsd_core_struct { @@ -51,7 +51,7 @@ struct netbsd_core_struct /* Handle NetBSD-style core dump file. */ -static const bfd_target * +static bfd_cleanup netbsd_core_file_p (bfd *abfd) { int val; @@ -60,9 +60,9 @@ netbsd_core_file_p (bfd *abfd) asection *asect; struct core core; struct coreseg coreseg; - bfd_size_type amt = sizeof core; + size_t amt = sizeof core; - val = bfd_bread (&core, amt, abfd); + val = bfd_read (&core, amt, abfd); if (val != sizeof core) { /* Too small to be a core file. */ @@ -93,7 +93,7 @@ netbsd_core_file_p (bfd *abfd) if (bfd_seek (abfd, offset, SEEK_SET) != 0) goto punt; - val = bfd_bread (&coreseg, sizeof coreseg, abfd); + val = bfd_read (&coreseg, sizeof coreseg, abfd); if (val != sizeof coreseg) { bfd_set_error (bfd_error_file_truncated); @@ -198,10 +198,6 @@ netbsd_core_file_p (bfd *abfd) bfd_default_set_arch_mach (abfd, bfd_arch_m68k, 0); break; - case M_88K_OPENBSD: - bfd_default_set_arch_mach (abfd, bfd_arch_m88k, 0); - break; - case M_HPPA_OPENBSD: bfd_default_set_arch_mach (abfd, bfd_arch_hppa, bfd_mach_hppa11); break; @@ -226,7 +222,7 @@ netbsd_core_file_p (bfd *abfd) } /* OK, we believe you. You're a core file (sure, sure). */ - return abfd->xvec; + return _bfd_no_cleanup; punt: bfd_release (abfd, abfd->tdata.any); @@ -261,11 +257,11 @@ swap_abort (void) #define NO_GET ((bfd_vma (*) (const void *)) swap_abort) #define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort) #define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort) -#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort) -#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort) -#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort) +#define NO_GET64 ((uint64_t (*) (const void *)) swap_abort) +#define NO_PUT64 ((void (*) (uint64_t, void *)) swap_abort) +#define NO_GETS64 ((int64_t (*) (const void *)) swap_abort) -const bfd_target netbsd_core_vec = +const bfd_target core_netbsd_vec = { "netbsd-core", bfd_target_unknown_flavour, @@ -279,6 +275,8 @@ const bfd_target netbsd_core_vec = 0, /* Symbol prefix. */ ' ', /* ar_pad_char. */ 16, /* ar_max_namelen. */ + 0, /* Match priority. */ + TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols. */ NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data. */ NO_GET, NO_GETS, NO_PUT, /* 32 bit data. */ NO_GET, NO_GETS, NO_PUT, /* 16 bit data. */ @@ -293,12 +291,16 @@ const bfd_target netbsd_core_vec = netbsd_core_file_p /* A core file. */ }, { /* bfd_set_format. */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, { /* bfd_write_contents. */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), @@ -313,5 +315,5 @@ const bfd_target netbsd_core_vec = NULL, - (PTR) 0 /* Backend_data. */ + NULL /* Backend_data. */ };