opcodes: handle mach-o for thumb/arm disambiguation.
[binutils-gdb.git] / bfd / versados.c
blob70e936ed7c03e8863f6ebe6c322278843a0c71fd
1 /* BFD back-end for VERSAdos-E objects.
2 Copyright (C) 1995-2015 Free Software Foundation, Inc.
3 Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
5 Versados is a Motorola trademark.
7 This file is part of BFD, the Binary File Descriptor library.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 MA 02110-1301, USA. */
25 SUBSECTION
26 VERSAdos-E relocatable object file format
28 DESCRIPTION
30 This module supports reading of VERSAdos relocatable
31 object files.
33 A VERSAdos file looks like contains
35 o Identification Record
36 o External Symbol Definition Record
37 o Object Text Record
38 o End Record. */
40 #include "sysdep.h"
41 #include "bfd.h"
42 #include "libbfd.h"
43 #include "libiberty.h"
46 #define VHEADER '1'
47 #define VESTDEF '2'
48 #define VOTR '3'
49 #define VEND '4'
51 #define ES_BASE 17 /* First symbol has esdid 17. */
53 /* Per file target dependent information. */
55 /* One for each section. */
56 struct esdid
58 asection *section; /* Ptr to bfd version. */
59 unsigned char *contents; /* Used to build image. */
60 bfd_size_type content_size; /* The size of the contents buffer. */
61 int pc;
62 int relocs; /* Reloc count, valid end of pass 1. */
63 int donerel; /* Have relocs been translated. */
66 typedef struct versados_data_struct
68 int es_done; /* Count of symbol index, starts at ES_BASE. */
69 asymbol *symbols; /* Pointer to local symbols. */
70 char *strings; /* Strings of all the above. */
71 int stringlen; /* Len of string table (valid end of pass1). */
72 int nsecsyms; /* Number of sections. */
74 int ndefs; /* Number of exported symbols (they dont get esdids). */
75 int nrefs; /* Number of imported symbols (valid end of pass1). */
77 int ref_idx; /* Current processed value of the above. */
78 int def_idx;
80 int pass_2_done;
82 struct esdid e[16]; /* Per section info. */
83 int alert; /* To see if we're trampling. */
84 asymbol *rest[256 - 16]; /* Per symbol info. */
86 tdata_type;
88 #define VDATA(abfd) (abfd->tdata.versados_data)
89 #define EDATA(abfd, n) (abfd->tdata.versados_data->e[(n) < 16 ? (n) : 0])
90 #define RDATA(abfd, n) (abfd->tdata.versados_data->rest[(n) < 240 ? (n) : 0])
92 struct ext_otr
94 unsigned char size;
95 char type;
96 unsigned char map[4];
97 unsigned char esdid;
98 unsigned char data[200];
101 struct ext_vheader
103 unsigned char size;
104 char type; /* Record type. */
105 char name[10]; /* Module name. */
106 char rev; /* Module rev number. */
107 char lang;
108 char vol[4];
109 char user[2];
110 char cat[8];
111 char fname[8];
112 char ext[2];
113 char time[3];
114 char date[3];
115 char rest[211];
118 struct ext_esd
120 unsigned char size;
121 char type;
122 unsigned char esd_entries[1];
125 #define ESD_ABS 0
126 #define ESD_COMMON 1
127 #define ESD_STD_REL_SEC 2
128 #define ESD_SHRT_REL_SEC 3
129 #define ESD_XDEF_IN_SEC 4
130 #define ESD_XDEF_IN_ABS 5
131 #define ESD_XREF_SEC 6
132 #define ESD_XREF_SYM 7
134 union ext_any
136 unsigned char size;
137 struct ext_vheader header;
138 struct ext_esd esd;
139 struct ext_otr otr;
142 /* Initialize by filling in the hex conversion array. */
144 /* Set up the tdata information. */
146 static bfd_boolean
147 versados_mkobject (bfd *abfd)
149 if (abfd->tdata.versados_data == NULL)
151 bfd_size_type amt = sizeof (tdata_type);
152 tdata_type *tdata = bfd_alloc (abfd, amt);
154 if (tdata == NULL)
155 return FALSE;
156 abfd->tdata.versados_data = tdata;
157 tdata->symbols = NULL;
158 VDATA (abfd)->alert = 0x12345678;
161 bfd_default_set_arch_mach (abfd, bfd_arch_m68k, 0);
162 return TRUE;
165 /* Report a problem in an S record file. FIXME: This probably should
166 not call fprintf, but we really do need some mechanism for printing
167 error messages. */
169 static asymbol *
170 versados_new_symbol (bfd *abfd,
171 int snum,
172 const char *name,
173 bfd_vma val,
174 asection *sec)
176 asymbol *n = VDATA (abfd)->symbols + snum;
177 n->name = name;
178 n->value = val;
179 n->section = sec;
180 n->the_bfd = abfd;
181 n->flags = 0;
182 return n;
185 static bfd_boolean
186 get_record (bfd *abfd, union ext_any *ptr)
188 if (bfd_bread (&ptr->size, (bfd_size_type) 1, abfd) != 1
189 || (bfd_bread ((char *) ptr + 1, (bfd_size_type) ptr->size, abfd)
190 != ptr->size))
191 return FALSE;
194 bfd_size_type amt = ptr->size + 1;
196 if (amt < sizeof (* ptr))
197 memset ((char *) ptr + amt, 0, sizeof (* ptr) - amt);
200 return TRUE;
203 static int
204 get_4 (unsigned char **pp)
206 unsigned char *p = *pp;
208 *pp += 4;
209 return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3] << 0);
212 static void
213 get_10 (unsigned char **pp, char *name)
215 char *p = (char *) *pp;
216 int len = 10;
218 *pp += len;
219 while (*p != ' ' && len)
221 *name++ = *p++;
222 len--;
224 *name = 0;
227 static char *
228 new_symbol_string (bfd *abfd, const char *name)
230 char *n = VDATA (abfd)->strings;
232 strcpy (VDATA (abfd)->strings, name);
233 VDATA (abfd)->strings += strlen (VDATA (abfd)->strings) + 1;
234 return n;
237 static void
238 process_esd (bfd *abfd, struct ext_esd *esd, int pass)
240 /* Read through the ext def for the est entries. */
241 int togo = esd->size - 2;
242 bfd_vma size;
243 bfd_vma start;
244 asection *sec;
245 char name[11];
246 unsigned char *ptr = esd->esd_entries;
247 unsigned char *end = ptr + togo;
249 while (ptr < end)
251 int scn = *ptr & 0xf;
252 int typ = (*ptr >> 4) & 0xf;
254 /* Declare this section. */
255 sprintf (name, "%d", scn);
256 sec = bfd_make_section_old_way (abfd, strdup (name));
257 sec->target_index = scn;
258 EDATA (abfd, scn).section = sec;
259 ptr++;
261 switch (typ)
263 default:
264 abort ();
265 case ESD_XREF_SEC:
266 case ESD_XREF_SYM:
268 int snum = VDATA (abfd)->ref_idx++;
269 get_10 (&ptr, name);
270 if (pass == 1)
271 VDATA (abfd)->stringlen += strlen (name) + 1;
272 else
274 int esidx;
275 asymbol *s;
276 char *n = new_symbol_string (abfd, name);
278 s = versados_new_symbol (abfd, snum, n, (bfd_vma) 0,
279 bfd_und_section_ptr);
280 esidx = VDATA (abfd)->es_done++;
281 RDATA (abfd, esidx - ES_BASE) = s;
284 break;
286 case ESD_ABS:
287 size = get_4 (&ptr);
288 (void) size;
289 start = get_4 (&ptr);
290 (void) start;
291 break;
292 case ESD_STD_REL_SEC:
293 case ESD_SHRT_REL_SEC:
294 sec->size = get_4 (&ptr);
295 sec->flags |= SEC_ALLOC;
296 break;
297 case ESD_XDEF_IN_ABS:
298 sec = bfd_abs_section_ptr;
299 case ESD_XDEF_IN_SEC:
301 int snum = VDATA (abfd)->def_idx++;
302 bfd_vma val;
304 get_10 (&ptr, name);
305 val = get_4 (&ptr);
306 if (pass == 1)
307 /* Just remember the symbol. */
308 VDATA (abfd)->stringlen += strlen (name) + 1;
309 else
311 asymbol *s;
312 char *n = new_symbol_string (abfd, name);
314 s = versados_new_symbol (abfd, snum + VDATA (abfd)->nrefs, n,
315 val, sec);
316 s->flags |= BSF_GLOBAL;
319 break;
324 #define R_RELWORD 1
325 #define R_RELLONG 2
326 #define R_RELWORD_NEG 3
327 #define R_RELLONG_NEG 4
329 reloc_howto_type versados_howto_table[] =
331 HOWTO (R_RELWORD, 0, 1, 16, FALSE,
332 0, complain_overflow_dont, 0,
333 "+v16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
334 HOWTO (R_RELLONG, 0, 2, 32, FALSE,
335 0, complain_overflow_dont, 0,
336 "+v32", TRUE, 0xffffffff, 0xffffffff, FALSE),
338 HOWTO (R_RELWORD_NEG, 0, -1, 16, FALSE,
339 0, complain_overflow_dont, 0,
340 "-v16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
341 HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE,
342 0, complain_overflow_dont, 0,
343 "-v32", TRUE, 0xffffffff, 0xffffffff, FALSE),
346 static int
347 get_offset (int len, unsigned char *ptr)
349 int val = 0;
351 if (len)
353 int i;
355 val = *ptr++;
356 if (val & 0x80)
357 val |= ~0xff;
358 for (i = 1; i < len; i++)
359 val = (val << 8) | *ptr++;
362 return val;
365 static void
366 process_otr (bfd *abfd, struct ext_otr *otr, int pass)
368 unsigned long shift;
369 unsigned char *srcp = otr->data;
370 unsigned char *endp = (unsigned char *) otr + otr->size;
371 unsigned int bits = (otr->map[0] << 24)
372 | (otr->map[1] << 16)
373 | (otr->map[2] << 8)
374 | (otr->map[3] << 0);
376 struct esdid *esdid;
377 unsigned char *contents;
378 bfd_boolean need_contents = FALSE;
379 unsigned int dst_idx;
381 /* PR 17512: file: ac7da425. */
382 if (otr->esdid == 0)
383 return;
385 esdid = &EDATA (abfd, otr->esdid - 1);
386 contents = esdid->contents;
387 dst_idx = esdid->pc;
389 for (shift = ((unsigned long) 1 << 31); shift && srcp < endp; shift >>= 1)
391 if (bits & shift)
393 int flag = *srcp++;
394 int esdids = (flag >> 5) & 0x7;
395 int sizeinwords = ((flag >> 3) & 1) ? 2 : 1;
396 int offsetlen = flag & 0x7;
397 int j;
399 if (esdids == 0)
401 /* A zero esdid means the new pc is the offset given. */
402 dst_idx += get_offset (offsetlen, srcp);
403 srcp += offsetlen;
405 else
407 int val = get_offset (offsetlen, srcp + esdids);
409 if (pass == 1)
410 need_contents = TRUE;
411 else if (contents && dst_idx < esdid->content_size - sizeinwords * 2)
412 for (j = 0; j < sizeinwords * 2; j++)
414 contents[dst_idx + (sizeinwords * 2) - j - 1] = val;
415 val >>= 8;
418 for (j = 0; j < esdids; j++)
420 int id = *srcp++;
422 if (id)
424 int rn = EDATA (abfd, otr->esdid - 1).relocs++;
426 if (pass == 1)
428 /* This is the first pass over the data,
429 just remember that we need a reloc. */
431 else
433 arelent *n;
435 /* PR 17512: file: 54f733e0. */
436 if (EDATA (abfd, otr->esdid - 1).section == NULL)
437 continue;
438 n = EDATA (abfd, otr->esdid - 1).section->relocation + rn;
439 n->address = dst_idx;
440 n->sym_ptr_ptr = (asymbol **) (size_t) id;
441 n->addend = 0;
442 n->howto = versados_howto_table + ((j & 1) * 2) + (sizeinwords - 1);
446 srcp += offsetlen;
447 dst_idx += sizeinwords * 2;
450 else
452 need_contents = TRUE;
454 if (esdid->section && contents && dst_idx < esdid->content_size - 1)
455 if (pass == 2)
457 /* Absolute code, comes in 16 bit lumps. */
458 contents[dst_idx] = srcp[0];
459 contents[dst_idx + 1] = srcp[1];
462 dst_idx += 2;
463 srcp += 2;
467 EDATA (abfd, otr->esdid - 1).pc = dst_idx;
469 if (!contents && need_contents)
471 if (esdid->section)
473 bfd_size_type size;
475 size = esdid->section->size;
476 esdid->contents = bfd_alloc (abfd, size);
477 esdid->content_size = size;
479 else
480 esdid->contents = NULL;
484 static bfd_boolean
485 versados_scan (bfd *abfd)
487 bfd_boolean loop = TRUE;
488 int i;
489 int j;
490 int nsecs = 0;
491 bfd_size_type amt;
493 VDATA (abfd)->stringlen = 0;
494 VDATA (abfd)->nrefs = 0;
495 VDATA (abfd)->ndefs = 0;
496 VDATA (abfd)->ref_idx = 0;
497 VDATA (abfd)->def_idx = 0;
498 VDATA (abfd)->pass_2_done = 0;
500 while (loop)
502 union ext_any any;
504 if (!get_record (abfd, &any))
505 return FALSE;
506 switch (any.header.type)
508 case VHEADER:
509 break;
510 case VEND:
511 loop = FALSE;
512 break;
513 case VESTDEF:
514 process_esd (abfd, &any.esd, 1);
515 break;
516 case VOTR:
517 process_otr (abfd, &any.otr, 1);
518 break;
522 /* Now allocate space for the relocs and sections. */
523 VDATA (abfd)->nrefs = VDATA (abfd)->ref_idx;
524 VDATA (abfd)->ndefs = VDATA (abfd)->def_idx;
525 VDATA (abfd)->ref_idx = 0;
526 VDATA (abfd)->def_idx = 0;
528 abfd->symcount = VDATA (abfd)->nrefs + VDATA (abfd)->ndefs;
530 for (i = 0; i < 16; i++)
532 struct esdid *esdid = &EDATA (abfd, i);
534 if (esdid->section)
536 amt = (bfd_size_type) esdid->relocs * sizeof (arelent);
537 esdid->section->relocation = bfd_alloc (abfd, amt);
538 esdid->pc = 0;
540 if (esdid->contents)
541 esdid->section->flags |= SEC_HAS_CONTENTS | SEC_LOAD;
543 esdid->section->reloc_count = esdid->relocs;
544 if (esdid->relocs)
545 esdid->section->flags |= SEC_RELOC;
547 esdid->relocs = 0;
549 /* Add an entry into the symbol table for it. */
550 nsecs++;
551 VDATA (abfd)->stringlen += strlen (esdid->section->name) + 1;
555 abfd->symcount += nsecs;
557 amt = abfd->symcount;
558 amt *= sizeof (asymbol);
559 VDATA (abfd)->symbols = bfd_alloc (abfd, amt);
561 amt = VDATA (abfd)->stringlen;
562 VDATA (abfd)->strings = bfd_alloc (abfd, amt);
564 if ((VDATA (abfd)->symbols == NULL && abfd->symcount > 0)
565 || (VDATA (abfd)->strings == NULL && VDATA (abfd)->stringlen > 0))
566 return FALSE;
568 /* Actually fill in the section symbols,
569 we stick them at the end of the table. */
570 for (j = VDATA (abfd)->nrefs + VDATA (abfd)->ndefs, i = 0; i < 16; i++)
572 struct esdid *esdid = &EDATA (abfd, i);
573 asection *sec = esdid->section;
575 if (sec)
577 asymbol *s = VDATA (abfd)->symbols + j;
578 s->name = new_symbol_string (abfd, sec->name);
579 s->section = sec;
580 s->flags = BSF_LOCAL;
581 s->value = 0;
582 s->the_bfd = abfd;
583 j++;
587 if (abfd->symcount)
588 abfd->flags |= HAS_SYMS;
590 /* Set this to nsecs - since we've already planted the section
591 symbols. */
592 VDATA (abfd)->nsecsyms = nsecs;
594 VDATA (abfd)->ref_idx = 0;
596 return TRUE;
599 /* Check whether an existing file is a versados file. */
601 static const bfd_target *
602 versados_object_p (bfd *abfd)
604 struct ext_vheader ext;
605 unsigned char len;
606 tdata_type *tdata_save;
608 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
609 return NULL;
611 if (bfd_bread (&len, (bfd_size_type) 1, abfd) != 1)
613 if (bfd_get_error () != bfd_error_system_call)
614 bfd_set_error (bfd_error_wrong_format);
615 return NULL;
618 /* PR 17512: file: 726-2128-0.004. */
619 if (len < 13)
621 bfd_set_error (bfd_error_wrong_format);
622 return NULL;
625 if (bfd_bread (&ext.type, (bfd_size_type) len, abfd) != len)
627 if (bfd_get_error () != bfd_error_system_call)
628 bfd_set_error (bfd_error_wrong_format);
629 return NULL;
632 /* We guess that the language field will never be larger than 10.
633 In sample files, it is always either 0 or 1. Checking for this
634 prevents confusion with Intel Hex files. */
635 if (ext.type != VHEADER
636 || ext.lang > 10)
638 bfd_set_error (bfd_error_wrong_format);
639 return NULL;
642 /* OK, looks like a record, build the tdata and read in. */
643 tdata_save = abfd->tdata.versados_data;
644 if (!versados_mkobject (abfd) || !versados_scan (abfd))
646 abfd->tdata.versados_data = tdata_save;
647 return NULL;
650 return abfd->xvec;
653 static bfd_boolean
654 versados_pass_2 (bfd *abfd)
656 union ext_any any;
658 if (VDATA (abfd)->pass_2_done)
659 return 1;
661 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
662 return 0;
664 VDATA (abfd)->es_done = ES_BASE;
666 /* Read records till we get to where we want to be. */
667 while (1)
669 get_record (abfd, &any);
670 switch (any.header.type)
672 case VEND:
673 VDATA (abfd)->pass_2_done = 1;
674 return 1;
675 case VESTDEF:
676 process_esd (abfd, &any.esd, 2);
677 break;
678 case VOTR:
679 process_otr (abfd, &any.otr, 2);
680 break;
685 static bfd_boolean
686 versados_get_section_contents (bfd *abfd,
687 asection *section,
688 void * location,
689 file_ptr offset,
690 bfd_size_type count)
692 struct esdid *esdid;
694 if (!versados_pass_2 (abfd))
695 return FALSE;
697 esdid = &EDATA (abfd, section->target_index);
699 if (esdid->contents == NULL
700 || offset < 0
701 || (bfd_size_type) offset > esdid->content_size
702 || offset + count > esdid->content_size)
703 return FALSE;
705 memcpy (location, esdid->contents + offset, (size_t) count);
707 return TRUE;
710 #define versados_get_section_contents_in_window \
711 _bfd_generic_get_section_contents_in_window
713 static bfd_boolean
714 versados_set_section_contents (bfd *abfd ATTRIBUTE_UNUSED,
715 sec_ptr section ATTRIBUTE_UNUSED,
716 const void * location ATTRIBUTE_UNUSED,
717 file_ptr offset ATTRIBUTE_UNUSED,
718 bfd_size_type bytes_to_do ATTRIBUTE_UNUSED)
720 return FALSE;
723 static int
724 versados_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
725 struct bfd_link_info *info ATTRIBUTE_UNUSED)
727 return 0;
730 /* Return the amount of memory needed to read the symbol table. */
732 static long
733 versados_get_symtab_upper_bound (bfd *abfd)
735 return (bfd_get_symcount (abfd) + 1) * sizeof (asymbol *);
738 /* Return the symbol table. */
740 static long
741 versados_canonicalize_symtab (bfd *abfd, asymbol **alocation)
743 unsigned int symcount = bfd_get_symcount (abfd);
744 unsigned int i;
745 asymbol *s;
747 versados_pass_2 (abfd);
749 for (i = 0, s = VDATA (abfd)->symbols;
750 i < symcount;
751 s++, i++)
752 *alocation++ = s;
754 *alocation = NULL;
756 return symcount;
759 static void
760 versados_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED,
761 asymbol *symbol,
762 symbol_info *ret)
764 bfd_symbol_info (symbol, ret);
767 static void
768 versados_print_symbol (bfd *abfd,
769 void * afile,
770 asymbol *symbol,
771 bfd_print_symbol_type how)
773 FILE *file = (FILE *) afile;
775 switch (how)
777 case bfd_print_symbol_name:
778 fprintf (file, "%s", symbol->name);
779 break;
780 default:
781 bfd_print_symbol_vandf (abfd, (void *) file, symbol);
782 fprintf (file, " %-5s %s",
783 symbol->section->name,
784 symbol->name);
788 static long
789 versados_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED,
790 sec_ptr asect)
792 return (asect->reloc_count + 1) * sizeof (arelent *);
795 static long
796 versados_canonicalize_reloc (bfd *abfd,
797 sec_ptr section,
798 arelent **relptr,
799 asymbol **symbols)
801 unsigned int count;
802 arelent *src;
804 versados_pass_2 (abfd);
805 src = section->relocation;
807 if (!EDATA (abfd, section->target_index).donerel)
809 EDATA (abfd, section->target_index).donerel = 1;
810 /* Translate from indexes to symptr ptrs. */
811 for (count = 0; count < section->reloc_count; count++)
813 int esdid = (int) (size_t) src[count].sym_ptr_ptr;
815 if (esdid == 0)
816 src[count].sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
817 else if (esdid < ES_BASE)
819 /* Section relative thing. */
820 struct esdid *e = &EDATA (abfd, esdid - 1);
822 /* PR 17512: file:cd92277c. */
823 if (e->section)
824 src[count].sym_ptr_ptr = e->section->symbol_ptr_ptr;
825 else
826 src[count].sym_ptr_ptr = bfd_und_section_ptr->symbol_ptr_ptr;
828 /* PR 17512: file:3757-2936-0.004. */
829 else if ((unsigned) (esdid - ES_BASE) >= bfd_get_symcount (abfd))
830 src[count].sym_ptr_ptr = bfd_und_section_ptr->symbol_ptr_ptr;
831 else
832 src[count].sym_ptr_ptr = symbols + esdid - ES_BASE;
836 for (count = 0; count < section->reloc_count; count++)
837 *relptr++ = src++;
839 *relptr = 0;
840 return section->reloc_count;
843 #define versados_close_and_cleanup _bfd_generic_close_and_cleanup
844 #define versados_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
845 #define versados_new_section_hook _bfd_generic_new_section_hook
846 #define versados_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
847 #define versados_bfd_is_local_label_name bfd_generic_is_local_label_name
848 #define versados_get_lineno _bfd_nosymbols_get_lineno
849 #define versados_find_nearest_line _bfd_nosymbols_find_nearest_line
850 #define versados_find_line _bfd_nosymbols_find_line
851 #define versados_find_inliner_info _bfd_nosymbols_find_inliner_info
852 #define versados_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
853 #define versados_make_empty_symbol _bfd_generic_make_empty_symbol
854 #define versados_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
855 #define versados_read_minisymbols _bfd_generic_read_minisymbols
856 #define versados_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
857 #define versados_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
858 #define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
859 #define versados_set_arch_mach bfd_default_set_arch_mach
860 #define versados_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
861 #define versados_bfd_relax_section bfd_generic_relax_section
862 #define versados_bfd_gc_sections bfd_generic_gc_sections
863 #define versados_bfd_lookup_section_flags bfd_generic_lookup_section_flags
864 #define versados_bfd_merge_sections bfd_generic_merge_sections
865 #define versados_bfd_is_group_section bfd_generic_is_group_section
866 #define versados_bfd_discard_group bfd_generic_discard_group
867 #define versados_section_already_linked _bfd_generic_section_already_linked
868 #define versados_bfd_define_common_symbol bfd_generic_define_common_symbol
869 #define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
870 #define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols
871 #define versados_bfd_link_just_syms _bfd_generic_link_just_syms
872 #define versados_bfd_copy_link_hash_symbol_type \
873 _bfd_generic_copy_link_hash_symbol_type
874 #define versados_bfd_final_link _bfd_generic_final_link
875 #define versados_bfd_link_split_section _bfd_generic_link_split_section
877 const bfd_target m68k_versados_vec =
879 "versados", /* Name. */
880 bfd_target_versados_flavour,
881 BFD_ENDIAN_BIG, /* Target byte order. */
882 BFD_ENDIAN_BIG, /* Target headers byte order. */
883 (HAS_RELOC | EXEC_P | /* Object flags. */
884 HAS_LINENO | HAS_DEBUG |
885 HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
886 (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
887 | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
888 0, /* Leading underscore. */
889 ' ', /* AR_pad_char. */
890 16, /* AR_max_namelen. */
891 0, /* match priority. */
892 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
893 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
894 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
895 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
896 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
897 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */
900 _bfd_dummy_target,
901 versados_object_p, /* bfd_check_format. */
902 _bfd_dummy_target,
903 _bfd_dummy_target,
906 bfd_false,
907 versados_mkobject,
908 _bfd_generic_mkarchive,
909 bfd_false,
911 { /* bfd_write_contents. */
912 bfd_false,
913 bfd_false,
914 _bfd_write_archive_contents,
915 bfd_false,
918 BFD_JUMP_TABLE_GENERIC (versados),
919 BFD_JUMP_TABLE_COPY (_bfd_generic),
920 BFD_JUMP_TABLE_CORE (_bfd_nocore),
921 BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
922 BFD_JUMP_TABLE_SYMBOLS (versados),
923 BFD_JUMP_TABLE_RELOCS (versados),
924 BFD_JUMP_TABLE_WRITE (versados),
925 BFD_JUMP_TABLE_LINK (versados),
926 BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
928 NULL,
930 NULL