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 bfd_set_error (bfd_error_no_memory);
215 abfd->tdata.srec_data = tdata;
219 tdata->symbols = NULL;
220 tdata->symtail = NULL;
221 tdata->csymbols = NULL;
227 /* Read a byte from an S record file. Set *ERRORPTR if an error
228 occurred. Return EOF on error or end of file. */
231 srec_get_byte (abfd, errorptr)
237 if (bfd_read (&c, 1, 1, abfd) != 1)
239 if (bfd_get_error () != bfd_error_file_truncated)
244 return (int) (c & 0xff);
247 /* Report a problem in an S record file. FIXME: This probably should
248 not call fprintf, but we really do need some mechanism for printing
252 srec_bad_byte (abfd, lineno, c, error)
261 bfd_set_error (bfd_error_file_truncated);
268 sprintf (buf, "\\%03o", (unsigned int) c);
274 fprintf (stderr, "%s:%d: Unexpected character `%s' in S-record file\n",
275 bfd_get_filename (abfd), lineno, buf);
276 bfd_set_error (bfd_error_bad_value);
280 /* Add a new symbol found in an S-record file. */
283 srec_new_symbol (abfd, name, val)
288 struct srec_symbol *n;
290 n = (struct srec_symbol *) bfd_alloc (abfd, sizeof (struct srec_symbol));
293 bfd_set_error (bfd_error_no_memory);
300 if (abfd->tdata.srec_data->symbols == NULL)
301 abfd->tdata.srec_data->symbols = n;
303 abfd->tdata.srec_data->symtail->next = n;
304 abfd->tdata.srec_data->symtail = n;
312 /* Read the S record file and turn it into sections. We create a new
313 section for each contiguous set of bytes. */
320 unsigned int lineno = 1;
321 boolean error = false;
322 bfd_byte *buf = NULL;
324 asection *sec = NULL;
326 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
329 while ((c = srec_get_byte (abfd, &error)) != EOF)
331 /* We only build sections from contiguous S-records, so if this
332 is not an S-record, then stop building a section. */
333 if (c != 'S' && c != '\r' && c != '\n')
339 srec_bad_byte (abfd, lineno, c, error);
350 /* Starting a module name, which we ignore. */
351 while ((c = srec_get_byte (abfd, &error)) != '\n'
356 srec_bad_byte (abfd, lineno, c, error);
369 /* Starting a symbol definition. */
370 while ((c = srec_get_byte (abfd, &error)) != EOF
371 && (c == ' ' || c == '\t'))
375 srec_bad_byte (abfd, lineno, c, error);
379 obstack_1grow (&abfd->memory, c);
380 while ((c = srec_get_byte (abfd, &error)) != EOF
382 obstack_1grow (&abfd->memory, c);
385 srec_bad_byte (abfd, lineno, c, error);
389 symname = obstack_finish (&abfd->memory);
392 bfd_set_error (bfd_error_no_memory);
396 while ((c = srec_get_byte (abfd, &error)) != EOF
397 && (c == ' ' || c == '\t'))
401 srec_bad_byte (abfd, lineno, c, error);
405 /* Skip a dollar sign before the hex value. */
408 c = srec_get_byte (abfd, &error);
411 srec_bad_byte (abfd, lineno, c, error);
420 symval += NIBBLE (c);
421 c = srec_get_byte (abfd, &error);
424 if (c == EOF || ! isspace (c))
426 srec_bad_byte (abfd, lineno, c, error);
430 if (! srec_new_symbol (abfd, symname, symval))
447 /* Starting an S-record. */
449 pos = bfd_tell (abfd) - 1;
451 if (bfd_read (hdr, 1, 3, abfd) != 3)
454 if (! ISHEX (hdr[1]) || ! ISHEX (hdr[2]))
456 if (! ISHEX (hdr[1]))
460 srec_bad_byte (abfd, lineno, c, error);
464 bytes = HEX (hdr + 1);
465 if (bytes * 2 > bufsize)
469 buf = (bfd_byte *) malloc (bytes * 2);
472 bfd_set_error (bfd_error_no_memory);
478 if (bfd_read (buf, 1, bytes * 2, abfd) != bytes * 2)
481 /* Ignore the checksum byte. */
490 /* Prologue--ignore the file name, but stop building a
491 section at this point. */
496 address = HEX (data);
501 address = (address << 8) | HEX (data);
506 address = (address << 8) | HEX (data);
508 address = (address << 8) | HEX (data);
513 && sec->vma + sec->_raw_size == address)
515 /* This data goes at the end of the section we are
516 currently building. */
517 sec->_raw_size += bytes;
524 sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1);
525 secname = (char *) bfd_alloc (abfd, strlen (secbuf) + 1);
526 strcpy (secname, secbuf);
527 sec = bfd_make_section (abfd, secname);
530 sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
532 sec->_raw_size = bytes;
539 address = HEX (data);
543 address = (address << 8) | HEX (data);
547 address = (address << 8) | HEX (data);
549 address = (address << 8) | HEX (data);
552 /* This is a termination record. */
553 abfd->start_address = address;
579 /* Check whether an existing file is an S-record file. */
581 static const bfd_target *
589 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
590 || bfd_read (b, 1, 4, abfd) != 4)
593 if (b[0] != 'S' || !ISHEX (b[1]) || !ISHEX (b[2]) || !ISHEX (b[3]))
595 bfd_set_error (bfd_error_wrong_format);
599 if (! srec_mkobject (abfd)
600 || ! srec_scan (abfd))
606 /* Check whether an existing file is an S-record file with symbols. */
608 static const bfd_target *
609 symbolsrec_object_p (abfd)
616 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
617 || bfd_read (b, 1, 2, abfd) != 2)
620 if (b[0] != '$' || b[1] != '$')
622 bfd_set_error (bfd_error_wrong_format);
626 if (! srec_mkobject (abfd)
627 || ! srec_scan (abfd))
633 /* Read in the contents of a section in an S-record file. */
636 srec_read_section (abfd, section, contents)
642 bfd_size_type sofar = 0;
643 boolean error = false;
644 bfd_byte *buf = NULL;
647 if (bfd_seek (abfd, section->filepos, SEEK_SET) != 0)
650 while ((c = srec_get_byte (abfd, &error)) != EOF)
657 if (c == '\r' || c == '\n')
660 /* This is called after srec_scan has already been called, so we
661 ought to know the exact format. */
662 BFD_ASSERT (c == 'S');
664 if (bfd_read (hdr, 1, 3, abfd) != 3)
667 BFD_ASSERT (ISHEX (hdr[1]) && ISHEX (hdr[2]));
669 bytes = HEX (hdr + 1);
671 if (bytes * 2 > bufsize)
675 buf = (bfd_byte *) malloc (bytes * 2);
678 bfd_set_error (bfd_error_no_memory);
684 if (bfd_read (buf, 1, bytes * 2, abfd) != bytes * 2)
692 BFD_ASSERT (sofar == section->_raw_size);
698 address = HEX (data);
703 address = (address << 8) | HEX (data);
708 address = (address << 8) | HEX (data);
710 address = (address << 8) | HEX (data);
714 if (address != section->vma + sofar)
716 /* We've come to the end of this section. */
717 BFD_ASSERT (sofar == section->_raw_size);
723 /* Don't consider checksum. */
728 contents[sofar] = HEX (data);
740 BFD_ASSERT (sofar == section->_raw_size);
753 /* Get the contents of a section in an S-record file. */
756 srec_get_section_contents (abfd, section, location, offset, count)
763 if (section->used_by_bfd == NULL)
765 section->used_by_bfd = bfd_alloc (abfd, section->_raw_size);
766 if (section->used_by_bfd == NULL
767 && section->_raw_size != 0)
769 bfd_set_error (bfd_error_no_memory);
773 if (! srec_read_section (abfd, section, section->used_by_bfd))
777 memcpy (location, (bfd_byte *) section->used_by_bfd + offset,
783 /* we have to save up all the Srecords for a splurge before output */
786 srec_set_section_contents (abfd, section, location, offset, bytes_to_do)
791 bfd_size_type bytes_to_do;
793 tdata_type *tdata = abfd->tdata.srec_data;
794 register srec_data_list_type *entry;
796 entry = ((srec_data_list_type *)
797 bfd_alloc (abfd, sizeof (srec_data_list_type)));
800 bfd_set_error (bfd_error_no_memory);
805 && (section->flags & SEC_ALLOC)
806 && (section->flags & SEC_LOAD))
808 bfd_byte *data = (bfd_byte *) bfd_alloc (abfd, bytes_to_do);
811 bfd_set_error (bfd_error_no_memory);
814 memcpy ((PTR) data, location, (size_t) bytes_to_do);
816 if ((section->lma + offset + bytes_to_do - 1) <= 0xffff)
820 else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
831 entry->where = section->lma + offset;
832 entry->size = bytes_to_do;
834 /* Sort the records by address. Optimize for the common case of
835 adding a record to the end of the list. */
836 if (tdata->tail != NULL
837 && entry->where >= tdata->tail->where)
839 tdata->tail->next = entry;
845 register srec_data_list_type **look;
847 for (look = &tdata->head;
848 *look != NULL && (*look)->where < entry->where;
849 look = &(*look)->next)
853 if (entry->next == NULL)
860 /* Write a record of type, of the supplied number of bytes. The
861 supplied bytes and length don't have a checksum. That's worked out
865 srec_write_record (abfd, type, address, data, end)
869 const bfd_byte *data;
872 char buffer[MAXCHUNK];
873 unsigned int check_sum = 0;
874 CONST bfd_byte *src = data;
883 dst += 2; /* leave room for dst*/
889 TOHEX (dst, (address >> 24), check_sum);
893 TOHEX (dst, (address >> 16), check_sum);
898 TOHEX (dst, (address >> 8), check_sum);
900 TOHEX (dst, (address), check_sum);
905 for (src = data; src < end; src++)
907 TOHEX (dst, *src, check_sum);
911 /* Fill in the length */
912 TOHEX (length, (dst - length) / 2, check_sum);
914 check_sum = 255 - check_sum;
915 TOHEX (dst, check_sum, check_sum);
920 wrlen = dst - buffer;
921 if (bfd_write ((PTR) buffer, 1, wrlen, abfd) != wrlen)
929 srec_write_header (abfd)
932 bfd_byte buffer[MAXCHUNK];
933 bfd_byte *dst = buffer;
936 /* I'll put an arbitary 40 char limit on header size */
937 for (i = 0; i < 40 && abfd->filename[i]; i++)
939 *dst++ = abfd->filename[i];
941 return srec_write_record (abfd, 0, 0, buffer, dst);
945 srec_write_section (abfd, tdata, list)
948 srec_data_list_type *list;
950 unsigned int bytes_written = 0;
951 bfd_byte *location = list->data;
953 while (bytes_written < list->size)
957 unsigned int bytes_this_chunk = list->size - bytes_written;
959 if (bytes_this_chunk > CHUNK)
961 bytes_this_chunk = CHUNK;
964 address = list->where + bytes_written;
966 if (! srec_write_record (abfd,
970 location + bytes_this_chunk))
973 bytes_written += bytes_this_chunk;
974 location += bytes_this_chunk;
981 srec_write_terminator (abfd, tdata)
987 return srec_write_record (abfd, 10 - tdata->type,
988 abfd->start_address, buffer, buffer);
994 srec_write_symbols (abfd)
997 char buffer[MAXCHUNK];
998 /* Dump out the symbols of a bfd */
1000 int count = bfd_get_symcount (abfd);
1005 asymbol **table = bfd_get_outsymbols (abfd);
1006 sprintf (buffer, "$$ %s\r\n", abfd->filename);
1008 len = strlen (buffer);
1009 if (bfd_write (buffer, len, 1, abfd) != len)
1012 for (i = 0; i < count; i++)
1014 asymbol *s = table[i];
1016 int len = strlen (s->name);
1018 /* If this symbol has a .[ocs] in it, it's probably a file name
1019 and we'll output that as the module name */
1021 if (len > 3 && s->name[len - 2] == '.')
1024 sprintf (buffer, "$$ %s\r\n", s->name);
1025 l = strlen (buffer);
1026 if (bfd_write (buffer, l, 1, abfd) != l)
1031 if (s->flags & (BSF_GLOBAL | BSF_LOCAL)
1032 && (s->flags & BSF_DEBUGGING) == 0
1033 && s->name[0] != '.'
1034 && s->name[0] != 't')
1036 /* Just dump out non debug symbols */
1041 s->value + s->section->output_section->lma
1042 + s->section->output_offset);
1044 while (p[0] == '0' && p[1] != 0)
1046 sprintf (buffer, " %s $%s\r\n", s->name, p);
1047 l = strlen (buffer);
1048 if (bfd_write (buffer, l, 1, abfd) != l)
1052 sprintf (buffer, "$$ \r\n");
1053 len = strlen (buffer);
1054 if (bfd_write (buffer, len, 1, abfd) != len)
1062 internal_srec_write_object_contents (abfd, symbols)
1066 tdata_type *tdata = abfd->tdata.srec_data;
1067 srec_data_list_type *list;
1071 if (! srec_write_symbols (abfd))
1075 if (! srec_write_header (abfd))
1078 /* Now wander though all the sections provided and output them */
1081 while (list != (srec_data_list_type *) NULL)
1083 if (! srec_write_section (abfd, tdata, list))
1087 return srec_write_terminator (abfd, tdata);
1091 srec_write_object_contents (abfd)
1094 return internal_srec_write_object_contents (abfd, 0);
1098 symbolsrec_write_object_contents (abfd)
1101 return internal_srec_write_object_contents (abfd, 1);
1106 srec_sizeof_headers (abfd, exec)
1114 srec_make_empty_symbol (abfd)
1117 asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
1119 new->the_bfd = abfd;
1123 /* Return the amount of memory needed to read the symbol table. */
1126 srec_get_symtab_upper_bound (abfd)
1129 return (bfd_get_symcount (abfd) + 1) * sizeof (asymbol *);
1132 /* Return the symbol table. */
1135 srec_get_symtab (abfd, alocation)
1137 asymbol **alocation;
1139 unsigned int symcount = bfd_get_symcount (abfd);
1143 csymbols = abfd->tdata.srec_data->csymbols;
1144 if (csymbols == NULL)
1147 struct srec_symbol *s;
1149 csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol));
1150 if (csymbols == NULL && symcount != 0)
1152 bfd_set_error (bfd_error_no_memory);
1155 abfd->tdata.srec_data->csymbols = csymbols;
1157 for (s = abfd->tdata.srec_data->symbols, c = csymbols;
1164 c->flags = BSF_GLOBAL;
1165 c->section = bfd_abs_section_ptr;
1170 for (i = 0; i < symcount; i++)
1171 *alocation++ = csymbols++;
1179 srec_get_symbol_info (ignore_abfd, symbol, ret)
1184 bfd_symbol_info (symbol, ret);
1189 srec_print_symbol (ignore_abfd, afile, symbol, how)
1193 bfd_print_symbol_type how;
1195 FILE *file = (FILE *) afile;
1198 case bfd_print_symbol_name:
1199 fprintf (file, "%s", symbol->name);
1202 bfd_print_symbol_vandf ((PTR) file, symbol);
1203 fprintf (file, " %-5s %s",
1204 symbol->section->name,
1210 #define srec_close_and_cleanup _bfd_generic_close_and_cleanup
1211 #define srec_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
1212 #define srec_new_section_hook _bfd_generic_new_section_hook
1214 #define srec_bfd_is_local_label bfd_generic_is_local_label
1215 #define srec_get_lineno _bfd_nosymbols_get_lineno
1216 #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
1217 #define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
1218 #define srec_read_minisymbols _bfd_generic_read_minisymbols
1219 #define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
1221 #define srec_get_reloc_upper_bound \
1222 ((long (*) PARAMS ((bfd *, asection *))) bfd_0l)
1223 #define srec_canonicalize_reloc \
1224 ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) bfd_0l)
1225 #define srec_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
1227 #define srec_set_arch_mach bfd_default_set_arch_mach
1229 #define srec_bfd_get_relocated_section_contents \
1230 bfd_generic_get_relocated_section_contents
1231 #define srec_bfd_relax_section bfd_generic_relax_section
1232 #define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
1233 #define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
1234 #define srec_bfd_final_link _bfd_generic_final_link
1235 #define srec_bfd_link_split_section _bfd_generic_link_split_section
1237 const bfd_target srec_vec =
1240 bfd_target_srec_flavour,
1241 true, /* target byte order */
1242 true, /* target headers byte order */
1243 (HAS_RELOC | EXEC_P | /* object flags */
1244 HAS_LINENO | HAS_DEBUG |
1245 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
1246 (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
1247 | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
1248 0, /* leading underscore */
1249 ' ', /* ar_pad_char */
1250 16, /* ar_max_namelen */
1251 1, /* minimum alignment */
1252 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1253 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1254 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
1255 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1256 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1257 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
1261 srec_object_p, /* bfd_check_format */
1268 _bfd_generic_mkarchive,
1271 { /* bfd_write_contents */
1273 srec_write_object_contents,
1274 _bfd_write_archive_contents,
1278 BFD_JUMP_TABLE_GENERIC (srec),
1279 BFD_JUMP_TABLE_COPY (_bfd_generic),
1280 BFD_JUMP_TABLE_CORE (_bfd_nocore),
1281 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
1282 BFD_JUMP_TABLE_SYMBOLS (srec),
1283 BFD_JUMP_TABLE_RELOCS (srec),
1284 BFD_JUMP_TABLE_WRITE (srec),
1285 BFD_JUMP_TABLE_LINK (srec),
1286 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
1293 const bfd_target symbolsrec_vec =
1295 "symbolsrec", /* name */
1296 bfd_target_srec_flavour,
1297 true, /* target byte order */
1298 true, /* target headers byte order */
1299 (HAS_RELOC | EXEC_P | /* object flags */
1300 HAS_LINENO | HAS_DEBUG |
1301 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
1302 (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
1303 | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
1304 0, /* leading underscore */
1305 ' ', /* ar_pad_char */
1306 16, /* ar_max_namelen */
1307 1, /* minimum alignment */
1308 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1309 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1310 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
1311 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1312 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1313 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
1317 symbolsrec_object_p, /* bfd_check_format */
1324 _bfd_generic_mkarchive,
1327 { /* bfd_write_contents */
1329 symbolsrec_write_object_contents,
1330 _bfd_write_archive_contents,
1334 BFD_JUMP_TABLE_GENERIC (srec),
1335 BFD_JUMP_TABLE_COPY (_bfd_generic),
1336 BFD_JUMP_TABLE_CORE (_bfd_nocore),
1337 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
1338 BFD_JUMP_TABLE_SYMBOLS (srec),
1339 BFD_JUMP_TABLE_RELOCS (srec),
1340 BFD_JUMP_TABLE_WRITE (srec),
1341 BFD_JUMP_TABLE_LINK (srec),
1342 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),