1 /* BFD back-end for s-record objects.
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
3 Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
27 Ordinary S-Records cannot hold anything but addresses and
28 data, so that's all that we implement.
30 The only interesting thing is that S-Records may come out of
31 order and there is no header, so an initial scan is required
32 to discover the minimum and maximum addresses used to create
33 the vma and size of the only section we create. We
34 arbitrarily call this section ".text".
36 When bfd_get_section_contents is called the file is read
37 again, and this time the data is placed into a bfd_alloc'd
40 Any number of sections may be created for output, we save them
41 up and output them when it's time to close the bfd.
43 An s record looks like:
46 S<type><length><address><data><checksum>
51 is the number of bytes following upto the checksum. Note that
52 this is not the number of chars following, since it takes two
53 chars to represent a byte.
57 1) two byte address data record
58 2) three byte address data record
59 3) four byte address data record
60 7) four byte address termination record
61 8) three byte address termination record
62 9) two byte address termination record
65 is the start address of the data following, or in the case of
66 a termination record, the start address of the image
70 is the sum of all the raw byte data in the record, from the length
71 upwards, modulo 256 and subtracted from 255.
75 Symbol S-Record handling
78 Some ICE equipment understands an addition to the standard
79 S-Record format; symbols and their addresses can be sent
82 The format of this is:
84 (<space> <symbol> <address>)*)
87 so a short symbol table could look like:
101 We allow symbols to be anywhere in the data stream - the module names
109 #include "libiberty.h"
112 static void srec_init PARAMS ((void));
113 static boolean srec_mkobject PARAMS ((bfd *));
114 static int srec_get_byte PARAMS ((bfd *, boolean *));
115 static void srec_bad_byte PARAMS ((bfd *, unsigned int, int, boolean));
116 static boolean srec_scan PARAMS ((bfd *));
117 static const bfd_target *srec_object_p PARAMS ((bfd *));
118 static const bfd_target *symbolsrec_object_p PARAMS ((bfd *));
119 static boolean srec_read_section PARAMS ((bfd *, asection *, bfd_byte *));
121 static boolean srec_write_record PARAMS ((bfd *, int, bfd_vma,
124 static boolean srec_write_header PARAMS ((bfd *));
125 static boolean srec_write_symbols PARAMS ((bfd *));
127 /* Macros for converting between hex and binary. */
129 static CONST char digs[] = "0123456789ABCDEF";
131 #define NIBBLE(x) hex_value(x)
132 #define HEX(buffer) ((NIBBLE((buffer)[0])<<4) + NIBBLE((buffer)[1]))
133 #define TOHEX(d, x, ch) \
134 d[1] = digs[(x) & 0xf]; \
135 d[0] = digs[((x)>>4)&0xf]; \
137 #define ISHEX(x) hex_p(x)
139 /* Initialize by filling in the hex conversion array. */
144 static boolean inited = false;
153 /* The maximum number of bytes on a line is FF */
154 #define MAXCHUNK 0xff
155 /* The number of bytes we fit onto a line on output */
158 /* When writing an S-record file, the S-records can not be output as
159 they are seen. This structure is used to hold them in memory. */
161 struct srec_data_list_struct
163 struct srec_data_list_struct *next;
169 typedef struct srec_data_list_struct srec_data_list_type;
171 /* When scanning the S-record file, a linked list of srec_symbol
172 structures is built to represent the symbol table (if there is
177 struct srec_symbol *next;
182 /* The S-record tdata information. */
184 typedef struct srec_data_struct
186 srec_data_list_type *head;
187 srec_data_list_type *tail;
189 struct srec_symbol *symbols;
190 struct srec_symbol *symtail;
195 static boolean srec_write_section PARAMS ((bfd *, tdata_type *,
196 srec_data_list_type *));
197 static boolean srec_write_terminator PARAMS ((bfd *, tdata_type *));
199 /* Set up the S-record tdata information. */
207 if (abfd->tdata.srec_data == NULL)
209 tdata_type *tdata = (tdata_type *) bfd_alloc (abfd, sizeof (tdata_type));
212 abfd->tdata.srec_data = tdata;
216 tdata->symbols = NULL;
217 tdata->symtail = NULL;
218 tdata->csymbols = NULL;
224 /* Read a byte from an S record file. Set *ERRORPTR if an error
225 occurred. Return EOF on error or end of file. */
228 srec_get_byte (abfd, errorptr)
234 if (bfd_read (&c, 1, 1, abfd) != 1)
236 if (bfd_get_error () != bfd_error_file_truncated)
241 return (int) (c & 0xff);
244 /* Report a problem in an S record file. FIXME: This probably should
245 not call fprintf, but we really do need some mechanism for printing
249 srec_bad_byte (abfd, lineno, c, error)
258 bfd_set_error (bfd_error_file_truncated);
265 sprintf (buf, "\\%03o", (unsigned int) c);
271 (*_bfd_error_handler)
272 ("%s:%d: Unexpected character `%s' in S-record file\n",
273 bfd_get_filename (abfd), lineno, buf);
274 bfd_set_error (bfd_error_bad_value);
278 /* Add a new symbol found in an S-record file. */
281 srec_new_symbol (abfd, name, val)
286 struct srec_symbol *n;
288 n = (struct srec_symbol *) bfd_alloc (abfd, sizeof (struct srec_symbol));
295 if (abfd->tdata.srec_data->symbols == NULL)
296 abfd->tdata.srec_data->symbols = n;
298 abfd->tdata.srec_data->symtail->next = n;
299 abfd->tdata.srec_data->symtail = n;
307 /* Read the S record file and turn it into sections. We create a new
308 section for each contiguous set of bytes. */
315 unsigned int lineno = 1;
316 boolean error = false;
317 bfd_byte *buf = NULL;
319 asection *sec = NULL;
321 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
324 while ((c = srec_get_byte (abfd, &error)) != EOF)
326 /* We only build sections from contiguous S-records, so if this
327 is not an S-record, then stop building a section. */
328 if (c != 'S' && c != '\r' && c != '\n')
334 srec_bad_byte (abfd, lineno, c, error);
345 /* Starting a module name, which we ignore. */
346 while ((c = srec_get_byte (abfd, &error)) != '\n'
351 srec_bad_byte (abfd, lineno, c, error);
364 /* Starting a symbol definition. */
365 while ((c = srec_get_byte (abfd, &error)) != EOF
366 && (c == ' ' || c == '\t'))
370 srec_bad_byte (abfd, lineno, c, error);
374 obstack_1grow (&abfd->memory, c);
375 while ((c = srec_get_byte (abfd, &error)) != EOF
377 obstack_1grow (&abfd->memory, c);
380 srec_bad_byte (abfd, lineno, c, error);
384 symname = obstack_finish (&abfd->memory);
387 bfd_set_error (bfd_error_no_memory);
391 while ((c = srec_get_byte (abfd, &error)) != EOF
392 && (c == ' ' || c == '\t'))
396 srec_bad_byte (abfd, lineno, c, error);
400 /* Skip a dollar sign before the hex value. */
403 c = srec_get_byte (abfd, &error);
406 srec_bad_byte (abfd, lineno, c, error);
415 symval += NIBBLE (c);
416 c = srec_get_byte (abfd, &error);
419 if (c == EOF || ! isspace (c))
421 srec_bad_byte (abfd, lineno, c, error);
425 if (! srec_new_symbol (abfd, symname, symval))
442 /* Starting an S-record. */
444 pos = bfd_tell (abfd) - 1;
446 if (bfd_read (hdr, 1, 3, abfd) != 3)
449 if (! ISHEX (hdr[1]) || ! ISHEX (hdr[2]))
451 if (! ISHEX (hdr[1]))
455 srec_bad_byte (abfd, lineno, c, error);
459 bytes = HEX (hdr + 1);
460 if (bytes * 2 > bufsize)
464 buf = (bfd_byte *) malloc (bytes * 2);
467 bfd_set_error (bfd_error_no_memory);
473 if (bfd_read (buf, 1, bytes * 2, abfd) != bytes * 2)
476 /* Ignore the checksum byte. */
485 /* Prologue--ignore the file name, but stop building a
486 section at this point. */
491 address = HEX (data);
496 address = (address << 8) | HEX (data);
501 address = (address << 8) | HEX (data);
503 address = (address << 8) | HEX (data);
508 && sec->vma + sec->_raw_size == address)
510 /* This data goes at the end of the section we are
511 currently building. */
512 sec->_raw_size += bytes;
519 sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1);
520 secname = (char *) bfd_alloc (abfd, strlen (secbuf) + 1);
521 strcpy (secname, secbuf);
522 sec = bfd_make_section (abfd, secname);
525 sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
527 sec->_raw_size = bytes;
534 address = HEX (data);
538 address = (address << 8) | HEX (data);
542 address = (address << 8) | HEX (data);
544 address = (address << 8) | HEX (data);
547 /* This is a termination record. */
548 abfd->start_address = address;
574 /* Check whether an existing file is an S-record file. */
576 static const bfd_target *
584 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
585 || bfd_read (b, 1, 4, abfd) != 4)
588 if (b[0] != 'S' || !ISHEX (b[1]) || !ISHEX (b[2]) || !ISHEX (b[3]))
590 bfd_set_error (bfd_error_wrong_format);
594 if (! srec_mkobject (abfd)
595 || ! srec_scan (abfd))
601 /* Check whether an existing file is an S-record file with symbols. */
603 static const bfd_target *
604 symbolsrec_object_p (abfd)
611 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
612 || bfd_read (b, 1, 2, abfd) != 2)
615 if (b[0] != '$' || b[1] != '$')
617 bfd_set_error (bfd_error_wrong_format);
621 if (! srec_mkobject (abfd)
622 || ! srec_scan (abfd))
628 /* Read in the contents of a section in an S-record file. */
631 srec_read_section (abfd, section, contents)
637 bfd_size_type sofar = 0;
638 boolean error = false;
639 bfd_byte *buf = NULL;
642 if (bfd_seek (abfd, section->filepos, SEEK_SET) != 0)
645 while ((c = srec_get_byte (abfd, &error)) != EOF)
652 if (c == '\r' || c == '\n')
655 /* This is called after srec_scan has already been called, so we
656 ought to know the exact format. */
657 BFD_ASSERT (c == 'S');
659 if (bfd_read (hdr, 1, 3, abfd) != 3)
662 BFD_ASSERT (ISHEX (hdr[1]) && ISHEX (hdr[2]));
664 bytes = HEX (hdr + 1);
666 if (bytes * 2 > bufsize)
670 buf = (bfd_byte *) malloc (bytes * 2);
673 bfd_set_error (bfd_error_no_memory);
679 if (bfd_read (buf, 1, bytes * 2, abfd) != bytes * 2)
687 BFD_ASSERT (sofar == section->_raw_size);
693 address = HEX (data);
698 address = (address << 8) | HEX (data);
703 address = (address << 8) | HEX (data);
705 address = (address << 8) | HEX (data);
709 if (address != section->vma + sofar)
711 /* We've come to the end of this section. */
712 BFD_ASSERT (sofar == section->_raw_size);
718 /* Don't consider checksum. */
723 contents[sofar] = HEX (data);
735 BFD_ASSERT (sofar == section->_raw_size);
748 /* Get the contents of a section in an S-record file. */
751 srec_get_section_contents (abfd, section, location, offset, count)
758 if (section->used_by_bfd == NULL)
760 section->used_by_bfd = bfd_alloc (abfd, section->_raw_size);
761 if (section->used_by_bfd == NULL
762 && section->_raw_size != 0)
765 if (! srec_read_section (abfd, section, section->used_by_bfd))
769 memcpy (location, (bfd_byte *) section->used_by_bfd + offset,
775 /* we have to save up all the Srecords for a splurge before output */
778 srec_set_section_contents (abfd, section, location, offset, bytes_to_do)
783 bfd_size_type bytes_to_do;
785 tdata_type *tdata = abfd->tdata.srec_data;
786 register srec_data_list_type *entry;
788 entry = ((srec_data_list_type *)
789 bfd_alloc (abfd, sizeof (srec_data_list_type)));
794 && (section->flags & SEC_ALLOC)
795 && (section->flags & SEC_LOAD))
797 bfd_byte *data = (bfd_byte *) bfd_alloc (abfd, bytes_to_do);
800 memcpy ((PTR) data, location, (size_t) bytes_to_do);
802 if ((section->lma + offset + bytes_to_do - 1) <= 0xffff)
806 else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
817 entry->where = section->lma + offset;
818 entry->size = bytes_to_do;
820 /* Sort the records by address. Optimize for the common case of
821 adding a record to the end of the list. */
822 if (tdata->tail != NULL
823 && entry->where >= tdata->tail->where)
825 tdata->tail->next = entry;
831 register srec_data_list_type **look;
833 for (look = &tdata->head;
834 *look != NULL && (*look)->where < entry->where;
835 look = &(*look)->next)
839 if (entry->next == NULL)
846 /* Write a record of type, of the supplied number of bytes. The
847 supplied bytes and length don't have a checksum. That's worked out
851 srec_write_record (abfd, type, address, data, end)
855 const bfd_byte *data;
858 char buffer[MAXCHUNK];
859 unsigned int check_sum = 0;
860 CONST bfd_byte *src = data;
869 dst += 2; /* leave room for dst*/
875 TOHEX (dst, (address >> 24), check_sum);
879 TOHEX (dst, (address >> 16), check_sum);
884 TOHEX (dst, (address >> 8), check_sum);
886 TOHEX (dst, (address), check_sum);
891 for (src = data; src < end; src++)
893 TOHEX (dst, *src, check_sum);
897 /* Fill in the length */
898 TOHEX (length, (dst - length) / 2, check_sum);
900 check_sum = 255 - check_sum;
901 TOHEX (dst, check_sum, check_sum);
906 wrlen = dst - buffer;
907 if (bfd_write ((PTR) buffer, 1, wrlen, abfd) != wrlen)
915 srec_write_header (abfd)
918 bfd_byte buffer[MAXCHUNK];
919 bfd_byte *dst = buffer;
922 /* I'll put an arbitary 40 char limit on header size */
923 for (i = 0; i < 40 && abfd->filename[i]; i++)
925 *dst++ = abfd->filename[i];
927 return srec_write_record (abfd, 0, 0, buffer, dst);
931 srec_write_section (abfd, tdata, list)
934 srec_data_list_type *list;
936 unsigned int bytes_written = 0;
937 bfd_byte *location = list->data;
939 while (bytes_written < list->size)
943 unsigned int bytes_this_chunk = list->size - bytes_written;
945 if (bytes_this_chunk > CHUNK)
947 bytes_this_chunk = CHUNK;
950 address = list->where + bytes_written;
952 if (! srec_write_record (abfd,
956 location + bytes_this_chunk))
959 bytes_written += bytes_this_chunk;
960 location += bytes_this_chunk;
967 srec_write_terminator (abfd, tdata)
973 return srec_write_record (abfd, 10 - tdata->type,
974 abfd->start_address, buffer, buffer);
980 srec_write_symbols (abfd)
983 char buffer[MAXCHUNK];
984 /* Dump out the symbols of a bfd */
986 int count = bfd_get_symcount (abfd);
991 asymbol **table = bfd_get_outsymbols (abfd);
992 sprintf (buffer, "$$ %s\r\n", abfd->filename);
994 len = strlen (buffer);
995 if (bfd_write (buffer, len, 1, abfd) != len)
998 for (i = 0; i < count; i++)
1000 asymbol *s = table[i];
1002 int len = strlen (s->name);
1004 /* If this symbol has a .[ocs] in it, it's probably a file name
1005 and we'll output that as the module name */
1007 if (len > 3 && s->name[len - 2] == '.')
1010 sprintf (buffer, "$$ %s\r\n", s->name);
1011 l = strlen (buffer);
1012 if (bfd_write (buffer, l, 1, abfd) != l)
1017 if (s->flags & (BSF_GLOBAL | BSF_LOCAL)
1018 && (s->flags & BSF_DEBUGGING) == 0
1019 && s->name[0] != '.'
1020 && s->name[0] != 't')
1022 /* Just dump out non debug symbols */
1027 s->value + s->section->output_section->lma
1028 + s->section->output_offset);
1030 while (p[0] == '0' && p[1] != 0)
1032 sprintf (buffer, " %s $%s\r\n", s->name, p);
1033 l = strlen (buffer);
1034 if (bfd_write (buffer, l, 1, abfd) != l)
1038 sprintf (buffer, "$$ \r\n");
1039 len = strlen (buffer);
1040 if (bfd_write (buffer, len, 1, abfd) != len)
1048 internal_srec_write_object_contents (abfd, symbols)
1052 tdata_type *tdata = abfd->tdata.srec_data;
1053 srec_data_list_type *list;
1057 if (! srec_write_symbols (abfd))
1061 if (! srec_write_header (abfd))
1064 /* Now wander though all the sections provided and output them */
1067 while (list != (srec_data_list_type *) NULL)
1069 if (! srec_write_section (abfd, tdata, list))
1073 return srec_write_terminator (abfd, tdata);
1077 srec_write_object_contents (abfd)
1080 return internal_srec_write_object_contents (abfd, 0);
1084 symbolsrec_write_object_contents (abfd)
1087 return internal_srec_write_object_contents (abfd, 1);
1092 srec_sizeof_headers (abfd, exec)
1100 srec_make_empty_symbol (abfd)
1103 asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
1105 new->the_bfd = abfd;
1109 /* Return the amount of memory needed to read the symbol table. */
1112 srec_get_symtab_upper_bound (abfd)
1115 return (bfd_get_symcount (abfd) + 1) * sizeof (asymbol *);
1118 /* Return the symbol table. */
1121 srec_get_symtab (abfd, alocation)
1123 asymbol **alocation;
1125 unsigned int symcount = bfd_get_symcount (abfd);
1129 csymbols = abfd->tdata.srec_data->csymbols;
1130 if (csymbols == NULL)
1133 struct srec_symbol *s;
1135 csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol));
1136 if (csymbols == NULL && symcount != 0)
1138 abfd->tdata.srec_data->csymbols = csymbols;
1140 for (s = abfd->tdata.srec_data->symbols, c = csymbols;
1147 c->flags = BSF_GLOBAL;
1148 c->section = bfd_abs_section_ptr;
1153 for (i = 0; i < symcount; i++)
1154 *alocation++ = csymbols++;
1162 srec_get_symbol_info (ignore_abfd, symbol, ret)
1167 bfd_symbol_info (symbol, ret);
1172 srec_print_symbol (ignore_abfd, afile, symbol, how)
1176 bfd_print_symbol_type how;
1178 FILE *file = (FILE *) afile;
1181 case bfd_print_symbol_name:
1182 fprintf (file, "%s", symbol->name);
1185 bfd_print_symbol_vandf ((PTR) file, symbol);
1186 fprintf (file, " %-5s %s",
1187 symbol->section->name,
1193 #define srec_close_and_cleanup _bfd_generic_close_and_cleanup
1194 #define srec_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
1195 #define srec_new_section_hook _bfd_generic_new_section_hook
1197 #define srec_bfd_is_local_label bfd_generic_is_local_label
1198 #define srec_get_lineno _bfd_nosymbols_get_lineno
1199 #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
1200 #define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
1201 #define srec_read_minisymbols _bfd_generic_read_minisymbols
1202 #define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
1204 #define srec_get_reloc_upper_bound \
1205 ((long (*) PARAMS ((bfd *, asection *))) bfd_0l)
1206 #define srec_canonicalize_reloc \
1207 ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) bfd_0l)
1208 #define srec_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
1210 #define srec_get_section_contents_in_window \
1211 _bfd_generic_get_section_contents_in_window
1213 #define srec_set_arch_mach bfd_default_set_arch_mach
1215 #define srec_bfd_get_relocated_section_contents \
1216 bfd_generic_get_relocated_section_contents
1217 #define srec_bfd_relax_section bfd_generic_relax_section
1218 #define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
1219 #define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
1220 #define srec_bfd_final_link _bfd_generic_final_link
1221 #define srec_bfd_link_split_section _bfd_generic_link_split_section
1223 const bfd_target srec_vec =
1226 bfd_target_srec_flavour,
1227 true, /* target byte order */
1228 true, /* target headers byte order */
1229 (HAS_RELOC | EXEC_P | /* object flags */
1230 HAS_LINENO | HAS_DEBUG |
1231 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
1232 (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
1233 | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
1234 0, /* leading underscore */
1235 ' ', /* ar_pad_char */
1236 16, /* ar_max_namelen */
1237 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1238 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1239 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
1240 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1241 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1242 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
1246 srec_object_p, /* bfd_check_format */
1253 _bfd_generic_mkarchive,
1256 { /* bfd_write_contents */
1258 srec_write_object_contents,
1259 _bfd_write_archive_contents,
1263 BFD_JUMP_TABLE_GENERIC (srec),
1264 BFD_JUMP_TABLE_COPY (_bfd_generic),
1265 BFD_JUMP_TABLE_CORE (_bfd_nocore),
1266 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
1267 BFD_JUMP_TABLE_SYMBOLS (srec),
1268 BFD_JUMP_TABLE_RELOCS (srec),
1269 BFD_JUMP_TABLE_WRITE (srec),
1270 BFD_JUMP_TABLE_LINK (srec),
1271 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
1278 const bfd_target symbolsrec_vec =
1280 "symbolsrec", /* name */
1281 bfd_target_srec_flavour,
1282 true, /* target byte order */
1283 true, /* target headers byte order */
1284 (HAS_RELOC | EXEC_P | /* object flags */
1285 HAS_LINENO | HAS_DEBUG |
1286 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
1287 (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
1288 | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
1289 0, /* leading underscore */
1290 ' ', /* ar_pad_char */
1291 16, /* ar_max_namelen */
1292 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1293 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1294 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
1295 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1296 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1297 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
1301 symbolsrec_object_p, /* bfd_check_format */
1308 _bfd_generic_mkarchive,
1311 { /* bfd_write_contents */
1313 symbolsrec_write_object_contents,
1314 _bfd_write_archive_contents,
1318 BFD_JUMP_TABLE_GENERIC (srec),
1319 BFD_JUMP_TABLE_COPY (_bfd_generic),
1320 BFD_JUMP_TABLE_CORE (_bfd_nocore),
1321 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
1322 BFD_JUMP_TABLE_SYMBOLS (srec),
1323 BFD_JUMP_TABLE_RELOCS (srec),
1324 BFD_JUMP_TABLE_WRITE (srec),
1325 BFD_JUMP_TABLE_LINK (srec),
1326 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),