xref: /netbsd-src/external/gpl3/binutils.old/dist/bfd/cisco-core.c (revision e992f068c547fd6e84b3f104dc2340adcc955732)
175fd0b74Schristos /* BFD back-end for CISCO crash dumps.
2*e992f068Schristos    Copyright (C) 1994-2022 Free Software Foundation, Inc.
375fd0b74Schristos 
475fd0b74Schristos    This file is part of BFD, the Binary File Descriptor library.
575fd0b74Schristos 
675fd0b74Schristos    This program is free software; you can redistribute it and/or modify
775fd0b74Schristos    it under the terms of the GNU General Public License as published by
875fd0b74Schristos    the Free Software Foundation; either version 3 of the License, or
975fd0b74Schristos    (at your option) any later version.
1075fd0b74Schristos 
1175fd0b74Schristos    This program is distributed in the hope that it will be useful,
1275fd0b74Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1375fd0b74Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1475fd0b74Schristos    GNU General Public License for more details.
1575fd0b74Schristos 
1675fd0b74Schristos    You should have received a copy of the GNU General Public License
1775fd0b74Schristos    along with this program; if not, write to the Free Software
1875fd0b74Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1975fd0b74Schristos    MA 02110-1301, USA.  */
2075fd0b74Schristos 
2175fd0b74Schristos #include "sysdep.h"
2275fd0b74Schristos #include "bfd.h"
2375fd0b74Schristos #include "libbfd.h"
2475fd0b74Schristos /* core_file_failing_signal returns a host signal (this probably should
2575fd0b74Schristos    be fixed).  */
2675fd0b74Schristos #include <signal.h>
2775fd0b74Schristos 
2875fd0b74Schristos /* for MSVC builds */
2975fd0b74Schristos #ifndef SIGTRAP
3075fd0b74Schristos # define SIGTRAP 5
3175fd0b74Schristos #endif
3275fd0b74Schristos #ifndef SIGEMT
3375fd0b74Schristos # define SIGEMT 6
3475fd0b74Schristos #endif
3575fd0b74Schristos #ifndef SIGBUS
3675fd0b74Schristos # define SIGBUS 10
3775fd0b74Schristos #endif
3875fd0b74Schristos 
3975fd0b74Schristos int crash_info_locs[] =
4075fd0b74Schristos {
4175fd0b74Schristos   0x0250,	/* mips, ppc, x86, i960 */
4275fd0b74Schristos   0x0400,	/* m68k, mips, x86, i960 */
4375fd0b74Schristos   0x0FFC,	/* m68k, mips, ppc, x86, i960 */
4475fd0b74Schristos   0x3000,	/* ppc */
4575fd0b74Schristos   0x4FFC,	/* m68k */
4675fd0b74Schristos   -1
4775fd0b74Schristos };
4875fd0b74Schristos 
4975fd0b74Schristos #define CRASH_MAGIC	0xdead1234
5075fd0b74Schristos #define MASK_ADDR(x)	((x) & 0x0fffffff)	/* Mask crash info address */
5175fd0b74Schristos 
5275fd0b74Schristos typedef enum
5375fd0b74Schristos {
5475fd0b74Schristos   CRASH_REASON_NOTCRASHED = 0,
5575fd0b74Schristos   CRASH_REASON_EXCEPTION = 1,
5675fd0b74Schristos   CRASH_REASON_CORRUPT = 2,
5775fd0b74Schristos } crashreason;
5875fd0b74Schristos 
5975fd0b74Schristos typedef struct
6075fd0b74Schristos {
6175fd0b74Schristos   char magic[4];		/* Magic number */
6275fd0b74Schristos   char version[4];		/* Version number */
6375fd0b74Schristos   char reason[4];		/* Crash reason */
6475fd0b74Schristos   char cpu_vector[4];		/* CPU vector for exceptions */
6575fd0b74Schristos   char registers[4];		/* Pointer to saved registers */
6675fd0b74Schristos   char rambase[4];		/* Base of RAM (not in V1 crash info) */
6775fd0b74Schristos   char textbase[4];		/* Base of .text section (not in V3 crash info) */
6875fd0b74Schristos   char database[4];		/* Base of .data section (not in V3 crash info) */
6975fd0b74Schristos   char bssbase[4];		/* Base of .bss section (not in V3 crash info) */
7075fd0b74Schristos } crashinfo_external;
7175fd0b74Schristos 
7275fd0b74Schristos struct cisco_core_struct
7375fd0b74Schristos {
7475fd0b74Schristos   int sig;
7575fd0b74Schristos };
7675fd0b74Schristos 
7775fd0b74Schristos #define cisco_core_file_matches_executable_p generic_core_file_matches_executable_p
7875fd0b74Schristos #define cisco_core_file_pid _bfd_nocore_core_file_pid
7975fd0b74Schristos 
8075fd0b74Schristos /* Examine the file for a crash info struct at the offset given by
8175fd0b74Schristos    CRASH_INFO_LOC.  */
8275fd0b74Schristos 
83*e992f068Schristos static bfd_cleanup
cisco_core_file_validate(bfd * abfd,int crash_info_loc)8475fd0b74Schristos cisco_core_file_validate (bfd *abfd, int crash_info_loc)
8575fd0b74Schristos {
8675fd0b74Schristos   char buf[4];
8775fd0b74Schristos   unsigned int crashinfo_offset;
8875fd0b74Schristos   crashinfo_external crashinfo;
8975fd0b74Schristos   bfd_size_type nread;
9075fd0b74Schristos   unsigned int magic;
9175fd0b74Schristos   unsigned int version;
9275fd0b74Schristos   unsigned int rambase;
9375fd0b74Schristos   sec_ptr asect;
9475fd0b74Schristos   struct stat statbuf;
95*e992f068Schristos   size_t amt;
9675fd0b74Schristos   flagword flags;
9775fd0b74Schristos 
9875fd0b74Schristos   if (bfd_seek (abfd, (file_ptr) crash_info_loc, SEEK_SET) != 0)
9975fd0b74Schristos     return NULL;
10075fd0b74Schristos 
10175fd0b74Schristos   nread = bfd_bread (buf, (bfd_size_type) 4, abfd);
10275fd0b74Schristos   if (nread != 4)
10375fd0b74Schristos     {
10475fd0b74Schristos       if (bfd_get_error () != bfd_error_system_call)
10575fd0b74Schristos 	bfd_set_error (bfd_error_wrong_format);
10675fd0b74Schristos       return NULL;
10775fd0b74Schristos     }
10875fd0b74Schristos   crashinfo_offset = MASK_ADDR (bfd_get_32 (abfd, buf));
10975fd0b74Schristos 
11075fd0b74Schristos   if (bfd_seek (abfd, (file_ptr) crashinfo_offset, SEEK_SET) != 0)
11175fd0b74Schristos     {
11275fd0b74Schristos       /* Most likely we failed because of a bogus (huge) offset */
11375fd0b74Schristos       bfd_set_error (bfd_error_wrong_format);
11475fd0b74Schristos       return NULL;
11575fd0b74Schristos     }
11675fd0b74Schristos 
11775fd0b74Schristos   nread = bfd_bread (&crashinfo, (bfd_size_type) sizeof (crashinfo), abfd);
11875fd0b74Schristos   if (nread != sizeof (crashinfo))
11975fd0b74Schristos     {
12075fd0b74Schristos       if (bfd_get_error () != bfd_error_system_call)
12175fd0b74Schristos 	bfd_set_error (bfd_error_wrong_format);
12275fd0b74Schristos       return NULL;
12375fd0b74Schristos     }
12475fd0b74Schristos 
12575fd0b74Schristos   if (bfd_stat (abfd, &statbuf) < 0)
12675fd0b74Schristos     {
12775fd0b74Schristos       bfd_set_error (bfd_error_system_call);
12875fd0b74Schristos       return NULL;
12975fd0b74Schristos     }
13075fd0b74Schristos 
13175fd0b74Schristos   magic = bfd_get_32 (abfd, crashinfo.magic);
13275fd0b74Schristos   if (magic != CRASH_MAGIC)
13375fd0b74Schristos     {
13475fd0b74Schristos       bfd_set_error (bfd_error_wrong_format);
13575fd0b74Schristos       return NULL;
13675fd0b74Schristos     }
13775fd0b74Schristos 
13875fd0b74Schristos   version = bfd_get_32 (abfd, crashinfo.version);
13975fd0b74Schristos   if (version == 0)
14075fd0b74Schristos     {
14175fd0b74Schristos       bfd_set_error (bfd_error_wrong_format);
14275fd0b74Schristos       return NULL;
14375fd0b74Schristos     }
14475fd0b74Schristos   else if (version == 1)
14575fd0b74Schristos     {
14675fd0b74Schristos       /* V1 core dumps don't specify the dump base, assume 0 */
14775fd0b74Schristos       rambase = 0;
14875fd0b74Schristos     }
14975fd0b74Schristos   else
15075fd0b74Schristos     {
15175fd0b74Schristos       rambase = bfd_get_32 (abfd, crashinfo.rambase);
15275fd0b74Schristos     }
15375fd0b74Schristos 
15475fd0b74Schristos   /* OK, we believe you.  You're a core file.  */
15575fd0b74Schristos 
15675fd0b74Schristos   amt = sizeof (struct cisco_core_struct);
15775fd0b74Schristos   abfd->tdata.cisco_core_data = (struct cisco_core_struct *) bfd_zmalloc (amt);
15875fd0b74Schristos   if (abfd->tdata.cisco_core_data == NULL)
15975fd0b74Schristos     return NULL;
16075fd0b74Schristos 
16175fd0b74Schristos   switch ((crashreason) bfd_get_32 (abfd, crashinfo.reason))
16275fd0b74Schristos     {
16375fd0b74Schristos     case CRASH_REASON_NOTCRASHED:
16475fd0b74Schristos       /* Crash file probably came from write core.  */
16575fd0b74Schristos       abfd->tdata.cisco_core_data->sig = 0;
16675fd0b74Schristos       break;
16775fd0b74Schristos     case CRASH_REASON_CORRUPT:
16875fd0b74Schristos       /* The crash context area was corrupt -- proceed with caution.
16975fd0b74Schristos 	 We have no way of passing this information back to the caller.  */
17075fd0b74Schristos       abfd->tdata.cisco_core_data->sig = 0;
17175fd0b74Schristos       break;
17275fd0b74Schristos     case CRASH_REASON_EXCEPTION:
17375fd0b74Schristos       /* Crash occured due to CPU exception.  */
17475fd0b74Schristos 
17575fd0b74Schristos       /* This is 68k-specific; for MIPS we'll need to interpret
17675fd0b74Schristos 	 cpu_vector differently based on the target configuration
17775fd0b74Schristos 	 (since CISCO core files don't seem to have the processor
17875fd0b74Schristos 	 encoded in them).  */
17975fd0b74Schristos 
18075fd0b74Schristos       switch (bfd_get_32 (abfd, crashinfo.cpu_vector))
18175fd0b74Schristos 	{
18275fd0b74Schristos 	   /* bus error		  */
18375fd0b74Schristos 	case 2 : abfd->tdata.cisco_core_data->sig = SIGBUS; break;
18475fd0b74Schristos 	   /* address error	  */
18575fd0b74Schristos 	case 3 : abfd->tdata.cisco_core_data->sig = SIGBUS; break;
18675fd0b74Schristos 	   /* illegal instruction */
18775fd0b74Schristos 	case 4 : abfd->tdata.cisco_core_data->sig = SIGILL;  break;
18875fd0b74Schristos 	   /* zero divide	  */
18975fd0b74Schristos 	case 5 : abfd->tdata.cisco_core_data->sig = SIGFPE;  break;
19075fd0b74Schristos 	   /* chk instruction	  */
19175fd0b74Schristos 	case 6 : abfd->tdata.cisco_core_data->sig = SIGFPE; break;
19275fd0b74Schristos 	   /* trapv instruction	  */
19375fd0b74Schristos 	case 7 : abfd->tdata.cisco_core_data->sig = SIGFPE; break;
19475fd0b74Schristos 	   /* privilege violation */
19575fd0b74Schristos 	case 8 : abfd->tdata.cisco_core_data->sig = SIGSEGV; break;
19675fd0b74Schristos 	   /* trace trap	  */
19775fd0b74Schristos 	case 9 : abfd->tdata.cisco_core_data->sig = SIGTRAP;  break;
19875fd0b74Schristos 	   /* line 1010 emulator  */
19975fd0b74Schristos 	case 10: abfd->tdata.cisco_core_data->sig = SIGILL;  break;
20075fd0b74Schristos 	   /* line 1111 emulator  */
20175fd0b74Schristos 	case 11: abfd->tdata.cisco_core_data->sig = SIGILL;  break;
20275fd0b74Schristos 
20375fd0b74Schristos 	  /* Coprocessor protocol violation.  Using a standard MMU or FPU
20475fd0b74Schristos 	     this cannot be triggered by software.  Call it a SIGBUS.  */
20575fd0b74Schristos 	case 13: abfd->tdata.cisco_core_data->sig = SIGBUS;  break;
20675fd0b74Schristos 
20775fd0b74Schristos 	  /* interrupt		 */
20875fd0b74Schristos 	case 31: abfd->tdata.cisco_core_data->sig = SIGINT;  break;
20975fd0b74Schristos 	  /* breakpoint		 */
21075fd0b74Schristos 	case 33: abfd->tdata.cisco_core_data->sig = SIGTRAP;  break;
21175fd0b74Schristos 
21275fd0b74Schristos 	  /* floating point err	 */
21375fd0b74Schristos 	case 48: abfd->tdata.cisco_core_data->sig = SIGFPE;  break;
21475fd0b74Schristos 	  /* floating point err	 */
21575fd0b74Schristos 	case 49: abfd->tdata.cisco_core_data->sig = SIGFPE;  break;
21675fd0b74Schristos 	  /* zero divide	 */
21775fd0b74Schristos 	case 50: abfd->tdata.cisco_core_data->sig = SIGFPE;  break;
21875fd0b74Schristos 	  /* underflow		 */
21975fd0b74Schristos 	case 51: abfd->tdata.cisco_core_data->sig = SIGFPE;  break;
22075fd0b74Schristos 	  /* operand error	 */
22175fd0b74Schristos 	case 52: abfd->tdata.cisco_core_data->sig = SIGFPE;  break;
22275fd0b74Schristos 	   /* overflow		  */
22375fd0b74Schristos 	case 53: abfd->tdata.cisco_core_data->sig = SIGFPE;  break;
22475fd0b74Schristos 	  /* NAN		 */
22575fd0b74Schristos 	case 54: abfd->tdata.cisco_core_data->sig = SIGFPE;  break;
22675fd0b74Schristos 	default:
22775fd0b74Schristos #ifndef SIGEMT
22875fd0b74Schristos #define SIGEMT SIGTRAP
22975fd0b74Schristos #endif
23075fd0b74Schristos 	  /* "software generated"*/
23175fd0b74Schristos 	  abfd->tdata.cisco_core_data->sig = SIGEMT;
23275fd0b74Schristos 	}
23375fd0b74Schristos       break;
23475fd0b74Schristos     default:
23575fd0b74Schristos       /* Unknown crash reason.  */
23675fd0b74Schristos       abfd->tdata.cisco_core_data->sig = 0;
23775fd0b74Schristos       break;
23875fd0b74Schristos     }
23975fd0b74Schristos 
24075fd0b74Schristos   /* Create a ".data" section that maps the entire file, which is
24175fd0b74Schristos      essentially a dump of the target system's RAM.  */
24275fd0b74Schristos 
24375fd0b74Schristos   flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
24475fd0b74Schristos   asect = bfd_make_section_anyway_with_flags (abfd, ".data", flags);
24575fd0b74Schristos   if (asect == NULL)
24675fd0b74Schristos     goto error_return;
24775fd0b74Schristos   /* The size of memory is the size of the core file itself.  */
24875fd0b74Schristos   asect->size = statbuf.st_size;
24975fd0b74Schristos   asect->vma = rambase;
25075fd0b74Schristos   asect->filepos = 0;
25175fd0b74Schristos 
25275fd0b74Schristos   /* Create a ".crash" section to allow access to the saved
25375fd0b74Schristos      crash information.  */
25475fd0b74Schristos 
25575fd0b74Schristos   flags = SEC_HAS_CONTENTS;
25675fd0b74Schristos   asect = bfd_make_section_anyway_with_flags (abfd, ".crash", flags);
25775fd0b74Schristos   if (asect == NULL)
25875fd0b74Schristos     goto error_return;
25975fd0b74Schristos   asect->vma = 0;
26075fd0b74Schristos   asect->filepos = crashinfo_offset;
26175fd0b74Schristos   asect->size = sizeof (crashinfo);
26275fd0b74Schristos 
26375fd0b74Schristos   /* Create a ".reg" section to allow access to the saved
26475fd0b74Schristos      registers.  */
26575fd0b74Schristos 
26675fd0b74Schristos   asect = bfd_make_section_anyway_with_flags (abfd, ".reg", flags);
26775fd0b74Schristos   if (asect == NULL)
26875fd0b74Schristos     goto error_return;
26975fd0b74Schristos   asect->vma = 0;
27075fd0b74Schristos   asect->filepos = bfd_get_32 (abfd, crashinfo.registers) - rambase;
27175fd0b74Schristos   /* Since we don't know the exact size of the saved register info,
27275fd0b74Schristos      choose a register section size that is either the remaining part
27375fd0b74Schristos      of the file, or 1024, whichever is smaller.  */
27475fd0b74Schristos   nread = statbuf.st_size - asect->filepos;
27575fd0b74Schristos   asect->size = (nread < 1024) ? nread : 1024;
27675fd0b74Schristos 
277*e992f068Schristos   return _bfd_no_cleanup;
27875fd0b74Schristos 
27975fd0b74Schristos   /* Get here if we have already started filling out the BFD
28075fd0b74Schristos      and there is an error of some kind.  */
28175fd0b74Schristos 
28275fd0b74Schristos  error_return:
28375fd0b74Schristos   bfd_release (abfd, abfd->tdata.any);
28475fd0b74Schristos   abfd->tdata.any = NULL;
28575fd0b74Schristos   bfd_section_list_clear (abfd);
28675fd0b74Schristos   return NULL;
28775fd0b74Schristos }
28875fd0b74Schristos 
289*e992f068Schristos static bfd_cleanup
cisco_core_file_p(bfd * abfd)29075fd0b74Schristos cisco_core_file_p (bfd *abfd)
29175fd0b74Schristos {
29275fd0b74Schristos   int *crash_info_locp;
293*e992f068Schristos   bfd_cleanup cleanup = NULL;
29475fd0b74Schristos 
29575fd0b74Schristos   for (crash_info_locp = crash_info_locs;
296*e992f068Schristos        *crash_info_locp != -1 && cleanup == NULL;
29775fd0b74Schristos        crash_info_locp++)
29875fd0b74Schristos     {
299*e992f068Schristos       cleanup = cisco_core_file_validate (abfd, *crash_info_locp);
30075fd0b74Schristos     }
301*e992f068Schristos   return cleanup;
30275fd0b74Schristos }
30375fd0b74Schristos 
30475fd0b74Schristos static char *
cisco_core_file_failing_command(bfd * abfd ATTRIBUTE_UNUSED)30575fd0b74Schristos cisco_core_file_failing_command (bfd *abfd ATTRIBUTE_UNUSED)
30675fd0b74Schristos {
30775fd0b74Schristos   return NULL;
30875fd0b74Schristos }
30975fd0b74Schristos 
31075fd0b74Schristos static int
cisco_core_file_failing_signal(bfd * abfd ATTRIBUTE_UNUSED)31175fd0b74Schristos cisco_core_file_failing_signal (bfd *abfd ATTRIBUTE_UNUSED)
31275fd0b74Schristos {
31375fd0b74Schristos   return abfd->tdata.cisco_core_data->sig;
31475fd0b74Schristos }
31575fd0b74Schristos 
31675fd0b74Schristos extern const bfd_target core_cisco_le_vec;
31775fd0b74Schristos 
31875fd0b74Schristos const bfd_target core_cisco_be_vec =
31975fd0b74Schristos {
32075fd0b74Schristos   "cisco-ios-core-big",
32175fd0b74Schristos   bfd_target_unknown_flavour,
32275fd0b74Schristos   BFD_ENDIAN_BIG,		/* target byte order */
32375fd0b74Schristos   BFD_ENDIAN_BIG,		/* target headers byte order */
324ede78133Schristos   (HAS_RELOC | EXEC_P		/* object flags */
325ede78133Schristos    | HAS_LINENO | HAS_DEBUG
326ede78133Schristos    | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
32775fd0b74Schristos   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
32875fd0b74Schristos   0,				/* symbol prefix */
32975fd0b74Schristos   ' ',				/* ar_pad_char */
33075fd0b74Schristos   16,				/* ar_max_namelen */
33175fd0b74Schristos   0,				/* match priority.  */
332*e992f068Schristos   TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols.  */
33375fd0b74Schristos   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
33475fd0b74Schristos   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
33575fd0b74Schristos   bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
33675fd0b74Schristos   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
33775fd0b74Schristos   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
33875fd0b74Schristos   bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
33975fd0b74Schristos 
34075fd0b74Schristos   {				/* bfd_check_format */
34175fd0b74Schristos     _bfd_dummy_target,			/* unknown format */
34275fd0b74Schristos     _bfd_dummy_target,			/* object file */
34375fd0b74Schristos     _bfd_dummy_target,			/* archive */
34475fd0b74Schristos     cisco_core_file_p			/* a core file */
34575fd0b74Schristos   },
34675fd0b74Schristos   {				/* bfd_set_format */
347ede78133Schristos     _bfd_bool_bfd_false_error,
348ede78133Schristos     _bfd_bool_bfd_false_error,
349ede78133Schristos     _bfd_bool_bfd_false_error,
350ede78133Schristos     _bfd_bool_bfd_false_error
35175fd0b74Schristos   },
35275fd0b74Schristos   {				/* bfd_write_contents */
353ede78133Schristos     _bfd_bool_bfd_false_error,
354ede78133Schristos     _bfd_bool_bfd_false_error,
355ede78133Schristos     _bfd_bool_bfd_false_error,
356ede78133Schristos     _bfd_bool_bfd_false_error
35775fd0b74Schristos   },
35875fd0b74Schristos 
35975fd0b74Schristos   BFD_JUMP_TABLE_GENERIC (_bfd_generic),
36075fd0b74Schristos   BFD_JUMP_TABLE_COPY (_bfd_generic),
36175fd0b74Schristos   BFD_JUMP_TABLE_CORE (cisco),
36275fd0b74Schristos   BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
36375fd0b74Schristos   BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols),
36475fd0b74Schristos   BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
36575fd0b74Schristos   BFD_JUMP_TABLE_WRITE (_bfd_generic),
36675fd0b74Schristos   BFD_JUMP_TABLE_LINK (_bfd_nolink),
36775fd0b74Schristos   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
36875fd0b74Schristos 
36975fd0b74Schristos   &core_cisco_le_vec,
37075fd0b74Schristos 
37175fd0b74Schristos   NULL				/* backend_data */
37275fd0b74Schristos };
37375fd0b74Schristos 
37475fd0b74Schristos const bfd_target core_cisco_le_vec =
37575fd0b74Schristos {
37675fd0b74Schristos   "cisco-ios-core-little",
37775fd0b74Schristos   bfd_target_unknown_flavour,
37875fd0b74Schristos   BFD_ENDIAN_LITTLE,		/* target byte order */
37975fd0b74Schristos   BFD_ENDIAN_LITTLE,		/* target headers byte order */
380ede78133Schristos   (HAS_RELOC | EXEC_P		/* object flags */
381ede78133Schristos    | HAS_LINENO | HAS_DEBUG
382ede78133Schristos    | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
38375fd0b74Schristos   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
38475fd0b74Schristos   0,				/* symbol prefix */
38575fd0b74Schristos   ' ',				/* ar_pad_char */
38675fd0b74Schristos   16,				/* ar_max_namelen */
38775fd0b74Schristos   0,				/* match_priority */
388*e992f068Schristos   TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols.  */
38975fd0b74Schristos   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
39075fd0b74Schristos   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
39175fd0b74Schristos   bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
39275fd0b74Schristos   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
39375fd0b74Schristos   bfd_getl32, bfd_getl_signed_32, bfd_putl32,
39475fd0b74Schristos   bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
39575fd0b74Schristos 
39675fd0b74Schristos   {				/* bfd_check_format */
39775fd0b74Schristos     _bfd_dummy_target,			/* unknown format */
39875fd0b74Schristos     _bfd_dummy_target,			/* object file */
39975fd0b74Schristos     _bfd_dummy_target,			/* archive */
40075fd0b74Schristos     cisco_core_file_p			/* a core file */
40175fd0b74Schristos   },
40275fd0b74Schristos   {				/* bfd_set_format */
403ede78133Schristos     _bfd_bool_bfd_false_error,
404ede78133Schristos     _bfd_bool_bfd_false_error,
405ede78133Schristos     _bfd_bool_bfd_false_error,
406ede78133Schristos     _bfd_bool_bfd_false_error
40775fd0b74Schristos   },
40875fd0b74Schristos   {				/* bfd_write_contents */
409ede78133Schristos     _bfd_bool_bfd_false_error,
410ede78133Schristos     _bfd_bool_bfd_false_error,
411ede78133Schristos     _bfd_bool_bfd_false_error,
412ede78133Schristos     _bfd_bool_bfd_false_error
41375fd0b74Schristos   },
41475fd0b74Schristos 
41575fd0b74Schristos   BFD_JUMP_TABLE_GENERIC (_bfd_generic),
41675fd0b74Schristos   BFD_JUMP_TABLE_COPY (_bfd_generic),
41775fd0b74Schristos   BFD_JUMP_TABLE_CORE (cisco),
41875fd0b74Schristos   BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
41975fd0b74Schristos   BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols),
42075fd0b74Schristos   BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
42175fd0b74Schristos   BFD_JUMP_TABLE_WRITE (_bfd_generic),
42275fd0b74Schristos   BFD_JUMP_TABLE_LINK (_bfd_nolink),
42375fd0b74Schristos   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
42475fd0b74Schristos 
42575fd0b74Schristos   &core_cisco_be_vec,
42675fd0b74Schristos 
42775fd0b74Schristos   NULL				/* backend_data */
42875fd0b74Schristos };
429