Coverage Report

Created: 2026-03-10 08:46

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/binutils-gdb/bfd/coff-mcore.c
Line
Count
Source
1
/* BFD back-end for Motorola MCore COFF/PE
2
   Copyright (C) 1999-2026 Free Software Foundation, Inc.
3
4
   This file is part of BFD, the Binary File Descriptor library.
5
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 3 of the License, or
9
   (at your option) any later version.
10
11
   This program is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
   GNU General Public License for more details.
15
16
   You should have received a copy of the GNU General Public License
17
   along with this program; if not, write to the Free Software
18
   Foundation, 51 Franklin Street - Fifth Floor,
19
   Boston, MA 02110-1301, USA.  */
20
21
#ifndef COFF_WITH_PE
22
#error non-PE COFF unsupported
23
#endif
24
25
#include "sysdep.h"
26
#include "bfd.h"
27
#include "libbfd.h"
28
#include "coff/mcore.h"
29
#include "coff/internal.h"
30
#include "coff/pe.h"
31
#include "libcoff.h"
32
33
#ifdef BADMAG
34
#undef BADMAG
35
#endif
36
308k
#define BADMAG(x) MCOREBADMAG(x)
37
38
#ifndef NUM_ELEM
39
987
#define NUM_ELEM(A) (sizeof (A) / sizeof (A)[0])
40
#endif
41
42
/* This file is compiled more than once, but we only compile the
43
   final_link routine once.  */
44
extern bool mcore_bfd_coff_final_link
45
  (bfd *, struct bfd_link_info *);
46
static bfd_reloc_status_type mcore_coff_unsupported_reloc
47
  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
48
49

50
/* The NT loader points the toc register to &toc + 32768, in order to
51
   use the complete range of a 16-bit displacement. We have to adjust
52
   for this when we fix up loads displaced off the toc reg.  */
53
#define TOC_LOAD_ADJUSTMENT (-32768)
54
#define TOC_SECTION_NAME ".private.toc"
55
56
/* The main body of code is in coffcode.h.  */
57
141k
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 2
58
59
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
60
   from smaller values.  Start with zero, widen, *then* decrement.  */
61
#define MINUS_ONE (((bfd_vma)0) - 1)
62

63
static reloc_howto_type mcore_coff_howto_table[] =
64
{
65
  /* Unused: */
66
  HOWTO (IMAGE_REL_MCORE_ABSOLUTE,/* type */
67
   0,      /* rightshift */
68
   0,      /* size */
69
   0,      /* bitsize */
70
   false,      /* pc_relative */
71
   0,      /* bitpos */
72
   complain_overflow_dont, /* dont complain_on_overflow */
73
   NULL,       /* special_function */
74
   "ABSOLUTE",     /* name */
75
   false,      /* partial_inplace */
76
   0x00,       /* src_mask */
77
   0x00,       /* dst_mask */
78
   false),     /* pcrel_offset */
79
80
  HOWTO (IMAGE_REL_MCORE_ADDR32,/* type */
81
   0,     /* rightshift */
82
   4,     /* size */
83
   32,      /* bitsize */
84
   false,     /* pc_relative */
85
   0,     /* bitpos */
86
   complain_overflow_bitfield, /* complain_on_overflow */
87
   NULL,      /* special_function */
88
   "ADDR32",    /* name */
89
   true,      /* partial_inplace */
90
   0xffffffff,    /* src_mask */
91
   0xffffffff,    /* dst_mask */
92
   false),    /* pcrel_offset */
93
94
  /* 8 bits + 2 zero bits; jmpi/jsri/lrw instructions.
95
     Should not appear in object files.  */
96
  HOWTO (IMAGE_REL_MCORE_PCREL_IMM8BY4, /* type */
97
   2,     /* rightshift */
98
   2,     /* size */
99
   8,     /* bitsize */
100
   true,      /* pc_relative */
101
   0,     /* bitpos */
102
   complain_overflow_bitfield, /* complain_on_overflow */
103
   mcore_coff_unsupported_reloc, /* special_function */
104
   "IMM8BY4",   /* name */
105
   false,     /* partial_inplace */
106
   0,     /* src_mask */
107
   0,     /* dst_mask */
108
   true),     /* pcrel_offset */
109
110
  /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit
111
     Span 2k instructions == 4k bytes.
112
     Only useful pieces at the relocated address are the opcode (5 bits) */
113
  HOWTO (IMAGE_REL_MCORE_PCREL_IMM11BY2,/* type */
114
   1,     /* rightshift */
115
   2,     /* size */
116
   11,      /* bitsize */
117
   true,      /* pc_relative */
118
   0,     /* bitpos */
119
   complain_overflow_signed, /* complain_on_overflow */
120
   NULL,      /* special_function */
121
   "IMM11BY2",    /* name */
122
   false,     /* partial_inplace */
123
   0x0,     /* src_mask */
124
   0x7ff,     /* dst_mask */
125
   true),     /* pcrel_offset */
126
127
  /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported.  */
128
  HOWTO (IMAGE_REL_MCORE_PCREL_IMM4BY2, /* type */
129
   1,     /* rightshift */
130
   2,     /* size */
131
   4,     /* bitsize */
132
   true,      /* pc_relative */
133
   0,     /* bitpos */
134
   complain_overflow_bitfield, /* complain_on_overflow */
135
   mcore_coff_unsupported_reloc, /* special_function */
136
   "IMM4BY2",    /* name */
137
   false,     /* partial_inplace */
138
   0,     /* src_mask */
139
   0,     /* dst_mask */
140
   true),     /* pcrel_offset */
141
142
  /* 32-bit pc-relative. Eventually this will help support PIC code.  */
143
  HOWTO (IMAGE_REL_MCORE_PCREL_32,/* type */
144
   0,     /* rightshift */
145
   4,     /* size */
146
   32,      /* bitsize */
147
   true,      /* pc_relative */
148
   0,     /* bitpos */
149
   complain_overflow_bitfield, /* complain_on_overflow */
150
   NULL,      /* special_function */
151
   "PCREL_32",    /* name */
152
   false,     /* partial_inplace */
153
   0x0,     /* src_mask */
154
   0xffffffff,    /* dst_mask */
155
   true),     /* pcrel_offset */
156
157
  /* Like PCREL_IMM11BY2, this relocation indicates that there is a
158
     'jsri' at the specified address. There is a separate relocation
159
     entry for the literal pool entry that it references, but we
160
     might be able to change the jsri to a bsr if the target turns out
161
     to be close enough [even though we won't reclaim the literal pool
162
     entry, we'll get some runtime efficiency back]. Note that this
163
     is a relocation that we are allowed to safely ignore.  */
164
  HOWTO (IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2,/* type */
165
   1,     /* rightshift */
166
   2,     /* size */
167
   11,      /* bitsize */
168
   true,      /* pc_relative */
169
   0,     /* bitpos */
170
   complain_overflow_signed, /* complain_on_overflow */
171
   NULL,      /* special_function */
172
   "JSR_IMM11BY2",  /* name */
173
   false,     /* partial_inplace */
174
   0x0,     /* src_mask */
175
   0x7ff,     /* dst_mask */
176
   true),     /* pcrel_offset */
177
178
  HOWTO (IMAGE_REL_MCORE_RVA, /* type */
179
   0,     /* rightshift */
180
   4,     /* size */
181
   32,      /* bitsize */
182
   false,     /* pc_relative */
183
   0,     /* bitpos */
184
   complain_overflow_signed, /* complain_on_overflow */
185
   NULL,      /* special_function */
186
   "MCORE_RVA",   /* name */
187
   true,      /* partial_inplace */
188
   0xffffffff,    /* src_mask */
189
   0xffffffff,    /* dst_mask */
190
   true)      /* pcrel_offset */
191
};
192

193
/* Extend the coff_link_hash_table structure with a few M*Core specific fields.
194
   This allows us to store global data here without actually creating any
195
   global variables, which is a no-no in the BFD world.  */
196
typedef struct coff_mcore_link_hash_table
197
{
198
  /* The original coff_link_hash_table structure.  MUST be first field.  */
199
  struct coff_link_hash_table root;
200
201
  bfd *       bfd_of_toc_owner;
202
  long int      global_toc_size;
203
  long int      import_table_size;
204
  long int      first_thunk_address;
205
  long int      thunk_size;
206
}
207
mcore_hash_table;
208
209
/* Get the MCore coff linker hash table from a link_info structure.  */
210
#define coff_mcore_hash_table(info) \
211
  ((mcore_hash_table *) ((info)->hash))
212
213

214
/* Add an entry to the base file.  */
215
216
static bool
217
mcore_emit_base_file_entry (struct bfd_link_info *info,
218
          bfd *output_bfd,
219
          asection *input_section,
220
          bfd_vma reloc_offset)
221
0
{
222
0
  bfd_vma addr = reloc_offset
223
0
     - input_section->vma
224
0
     + input_section->output_offset
225
0
     + input_section->output_section->vma;
226
227
0
  if (obj_pe (output_bfd))
228
0
     addr -= pe_data (output_bfd)->pe_opthdr.ImageBase;
229
230
0
  if (fwrite (&addr, sizeof (addr), 1, (FILE *) info->base_file) == 1)
231
0
    return true;
232
233
0
  bfd_set_error (bfd_error_system_call);
234
0
  return false;
235
0
}
Unexecuted instantiation: pe-mcore.c:mcore_emit_base_file_entry
Unexecuted instantiation: pei-mcore.c:mcore_emit_base_file_entry
236

237
static bfd_reloc_status_type
238
mcore_coff_unsupported_reloc (bfd * abfd,
239
            arelent * reloc_entry,
240
            asymbol * symbol ATTRIBUTE_UNUSED,
241
            void * data ATTRIBUTE_UNUSED,
242
            asection * input_section ATTRIBUTE_UNUSED,
243
            bfd * output_bfd ATTRIBUTE_UNUSED,
244
            char ** error_message ATTRIBUTE_UNUSED)
245
0
{
246
0
  BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
247
248
  /* xgettext: c-format */
249
0
  _bfd_error_handler (_("%pB: Relocation %s (%d) is not currently supported.\n"),
250
0
          abfd,
251
0
          reloc_entry->howto->name,
252
0
          reloc_entry->howto->type);
253
254
0
  return bfd_reloc_notsupported;
255
0
}
Unexecuted instantiation: pe-mcore.c:mcore_coff_unsupported_reloc
Unexecuted instantiation: pei-mcore.c:mcore_coff_unsupported_reloc
256

257
/* A cheesy little macro to make the code a little more readable.  */
258
#define HOW2MAP(bfd_rtype, mcore_rtype)  \
259
0
 case bfd_rtype: return & mcore_coff_howto_table [mcore_rtype]
260
261
static reloc_howto_type *
262
mcore_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
263
            bfd_reloc_code_real_type code)
264
0
{
265
0
  switch (code)
266
0
    {
267
0
      HOW2MAP (BFD_RELOC_32,        IMAGE_REL_MCORE_ADDR32);
268
0
      HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM8BY4,     IMAGE_REL_MCORE_PCREL_IMM8BY4);
269
0
      HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM11BY2,    IMAGE_REL_MCORE_PCREL_IMM11BY2);
270
0
      HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM4BY2,     IMAGE_REL_MCORE_PCREL_IMM4BY2);
271
0
      HOW2MAP (BFD_RELOC_32_PCREL,      IMAGE_REL_MCORE_PCREL_32);
272
0
      HOW2MAP (BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2);
273
0
      HOW2MAP (BFD_RELOC_RVA,         IMAGE_REL_MCORE_RVA);
274
0
   default:
275
0
      return NULL;
276
0
    }
277
  /*NOTREACHED*/
278
0
}
Unexecuted instantiation: pe-mcore.c:mcore_coff_reloc_type_lookup
Unexecuted instantiation: pei-mcore.c:mcore_coff_reloc_type_lookup
279
#undef HOW2MAP
280
281
987
#define NUM_HOWTOS NUM_ELEM (mcore_coff_howto_table)
282
283
static reloc_howto_type *
284
mcore_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
285
            const char *r_name)
286
0
{
287
0
  unsigned int i;
288
289
0
  for (i = 0; i < NUM_HOWTOS; i++)
290
0
    if (mcore_coff_howto_table[i].name != NULL
291
0
  && strcasecmp (mcore_coff_howto_table[i].name, r_name) == 0)
292
0
      return &mcore_coff_howto_table[i];
293
294
0
  return NULL;
295
0
}
Unexecuted instantiation: pe-mcore.c:mcore_coff_reloc_name_lookup
Unexecuted instantiation: pei-mcore.c:mcore_coff_reloc_name_lookup
296
297
#define RTYPE2HOWTO(cache_ptr, dst)       \
298
987
  ((cache_ptr)->howto =           \
299
987
   ((dst)->r_type < NUM_HOWTOS          \
300
987
    ? mcore_coff_howto_table + (dst)->r_type      \
301
987
    : NULL))
302
303
static reloc_howto_type *
304
coff_mcore_rtype_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
305
         asection * sec,
306
         struct internal_reloc * rel,
307
         struct coff_link_hash_entry * h ATTRIBUTE_UNUSED,
308
         struct internal_syment * sym,
309
         bfd_vma * addendp)
310
0
{
311
0
  reloc_howto_type * howto;
312
313
0
  if (rel->r_type >= NUM_HOWTOS)
314
0
    return NULL;
315
316
0
  howto = mcore_coff_howto_table + rel->r_type;
317
318
0
  if (rel->r_type == IMAGE_REL_MCORE_RVA)
319
0
    * addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
320
321
0
  else if (howto->pc_relative)
322
0
    {
323
0
      * addendp = sec->vma - 2; /* XXX guess - is this right ? */
324
325
      /* If the symbol is defined, then the generic code is going to
326
   add back the symbol value in order to cancel out an
327
   adjustment it made to the addend.  However, we set the addend
328
   to 0 at the start of this function.  We need to adjust here,
329
   to avoid the adjustment the generic code will make.  FIXME:
330
   This is getting a bit hackish.  */
331
0
      if (sym != NULL && sym->n_scnum != 0)
332
0
  * addendp -= sym->n_value;
333
0
    }
334
0
  else
335
0
    * addendp = 0;
336
337
0
  return howto;
338
0
}
Unexecuted instantiation: pe-mcore.c:coff_mcore_rtype_to_howto
Unexecuted instantiation: pei-mcore.c:coff_mcore_rtype_to_howto
339
340
/* Return TRUE if this relocation should appear in the output .reloc section.
341
   This function is referenced in pe_mkobject in peicode.h.  */
342
343
static bool
344
in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED, reloc_howto_type * howto)
345
0
{
346
0
  return ! howto->pc_relative && howto->type != IMAGE_REL_MCORE_RVA;
347
0
}
Unexecuted instantiation: pe-mcore.c:in_reloc_p
Unexecuted instantiation: pei-mcore.c:in_reloc_p
348

349
/* The reloc processing routine for the optimized COFF linker.  */
350
static bool
351
coff_mcore_relocate_section (bfd * output_bfd,
352
           struct bfd_link_info * info,
353
           bfd * input_bfd,
354
           asection * input_section,
355
           bfd_byte * contents,
356
           struct internal_reloc * relocs,
357
           struct internal_syment * syms,
358
           asection ** sections)
359
0
{
360
0
  struct internal_reloc * rel;
361
0
  struct internal_reloc * relend;
362
363
  /* If we are performing a relocatable link, we don't need to do a
364
     thing.  The caller will take care of adjusting the reloc
365
     addresses and symbol indices.  */
366
0
  if (bfd_link_relocatable (info))
367
0
    return true;
368
369
  /* Check if we have the same endianness */
370
0
  if (   input_bfd->xvec->byteorder != output_bfd->xvec->byteorder
371
0
      && output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
372
0
    {
373
0
      _bfd_error_handler
374
  /* xgettext: c-format */
375
0
  (_("%pB: compiled for a %s system and target is %s.\n"),
376
0
   input_bfd,
377
0
   bfd_big_endian (input_bfd) ? _("big endian") : _("little endian"),
378
0
   bfd_big_endian (output_bfd) ? _("big endian") : _("little endian"));
379
380
0
      bfd_set_error (bfd_error_wrong_format);
381
0
      return false;
382
0
    }
383
384
0
  rel = relocs;
385
0
  relend = rel + input_section->reloc_count;
386
387
0
  for (; rel < relend; rel++)
388
0
    {
389
0
      long           symndx;
390
0
      struct internal_syment *       sym;
391
0
      bfd_vma          val;
392
0
      bfd_vma          addend;
393
0
      bfd_reloc_status_type      rstat;
394
0
      bfd_byte *         loc;
395
0
      unsigned short         r_type = rel->r_type;
396
0
      reloc_howto_type *       howto = NULL;
397
0
      struct coff_link_hash_entry *  h;
398
0
      const char *         my_name;
399
0
      char buf[SYMNMLEN + 1];
400
401
0
      symndx = rel->r_symndx;
402
0
      loc = contents + rel->r_vaddr - input_section->vma;
403
404
0
      if (symndx == -1)
405
0
  {
406
0
    h = NULL;
407
0
    sym = NULL;
408
0
  }
409
0
      else
410
0
  {
411
0
    h = obj_coff_sym_hashes (input_bfd)[symndx];
412
0
    sym = syms + symndx;
413
0
  }
414
415
0
      addend = 0;
416
417
      /* Get the howto and initialise the addend.  */
418
0
      howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h,
419
0
               sym, & addend);
420
0
      if (howto == NULL)
421
0
  return false;
422
423
0
      val = 0;
424
425
0
      if (h == NULL)
426
0
  {
427
0
    if (symndx == -1)
428
0
      my_name = "*ABS*";
429
0
    else
430
0
      {
431
0
        asection * sec = sections[symndx];
432
433
0
        val = (sym->n_value
434
0
         + sec->output_section->vma
435
0
         + sec->output_offset);
436
437
0
        if (sym == NULL)
438
0
    my_name = "*unknown*";
439
0
        else if (   sym->_n._n_n._n_zeroes == 0
440
0
           && sym->_n._n_n._n_offset != 0)
441
0
    {
442
0
      if (sym->_n._n_n._n_offset < obj_coff_strings_len (input_bfd))
443
0
        my_name = (obj_coff_strings (input_bfd)
444
0
             + sym->_n._n_n._n_offset);
445
0
      else
446
0
        my_name = "?";
447
0
    }
448
0
        else
449
0
    {
450
0
      strncpy (buf, sym->_n._n_name, SYMNMLEN);
451
0
      buf[SYMNMLEN] = '\0';
452
0
      my_name = buf;
453
0
    }
454
0
      }
455
0
  }
456
0
      else
457
0
  {
458
0
    if (   h->root.type == bfd_link_hash_defined
459
0
        || h->root.type == bfd_link_hash_defweak)
460
0
      {
461
0
        asection * sec = h->root.u.def.section;
462
463
0
        val = (h->root.u.def.value
464
0
         + sec->output_section->vma
465
0
         + sec->output_offset);
466
0
      }
467
0
    else
468
0
      (*info->callbacks->undefined_symbol)
469
0
        (info, h->root.root.string, input_bfd, input_section,
470
0
         rel->r_vaddr - input_section->vma, true);
471
472
0
    my_name = h->root.root.string;
473
0
  }
474
475
0
      rstat = bfd_reloc_ok;
476
477
      /* Each case must do its own relocation, setting rstat appropriately.  */
478
0
      switch (r_type)
479
0
  {
480
0
  default:
481
    /* xgettext: c-format */
482
0
    _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
483
0
            input_bfd, r_type);
484
0
    bfd_set_error (bfd_error_bad_value);
485
0
    return false;
486
487
0
  case IMAGE_REL_MCORE_ABSOLUTE:
488
0
    _bfd_error_handler
489
      /* xgettext: c-format */
490
0
      (_("warning: unsupported reloc %s <file %pB, section %pA>\n"
491
0
         "sym %ld (%s), r_vaddr %" PRId64 " (%#" PRIx64 ")"),
492
0
       howto->name, input_bfd, input_section,
493
0
       rel->r_symndx, my_name, (int64_t) rel->r_vaddr,
494
0
       (uint64_t) rel->r_vaddr);
495
0
    break;
496
497
0
  case IMAGE_REL_MCORE_PCREL_IMM8BY4:
498
0
  case IMAGE_REL_MCORE_PCREL_IMM11BY2:
499
0
  case IMAGE_REL_MCORE_PCREL_IMM4BY2:
500
0
  case IMAGE_REL_MCORE_PCREL_32:
501
0
  case IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2:
502
0
  case IMAGE_REL_MCORE_ADDR32:
503
    /* XXX fixme - shouldn't this be like the code for the RVA reloc ? */
504
0
    rstat = _bfd_relocate_contents (howto, input_bfd, val, loc);
505
0
    break;
506
507
0
  case IMAGE_REL_MCORE_RVA:
508
0
    rstat = _bfd_final_link_relocate
509
0
      (howto, input_bfd,
510
0
       input_section, contents, rel->r_vaddr - input_section->vma,
511
0
       val, addend);
512
0
    break;
513
0
  }
514
515
      /* Emit a reloc if the backend thinks it needs it.  */
516
0
      if (info->base_file
517
0
    && sym
518
0
    && pe_data (output_bfd)->in_reloc_p (output_bfd, howto)
519
0
    && !mcore_emit_base_file_entry (info, output_bfd, input_section,
520
0
            rel->r_vaddr))
521
0
  return false;
522
523
0
      switch (rstat)
524
0
  {
525
0
  default:
526
0
    abort ();
527
528
0
  case bfd_reloc_ok:
529
0
    break;
530
531
0
  case bfd_reloc_overflow:
532
0
    (*info->callbacks->reloc_overflow)
533
0
      (info, (h ? &h->root : NULL), my_name, howto->name,
534
0
       (bfd_vma) 0, input_bfd,
535
0
       input_section, rel->r_vaddr - input_section->vma);
536
0
  }
537
0
    }
538
539
0
  return true;
540
0
}
Unexecuted instantiation: pe-mcore.c:coff_mcore_relocate_section
Unexecuted instantiation: pei-mcore.c:coff_mcore_relocate_section
541

542
/* Tailor coffcode.h -- macro heaven.  */
543
544
/* We use the special COFF backend linker, with our own special touch.  */
545
546
#define coff_bfd_reloc_type_lookup   mcore_coff_reloc_type_lookup
547
#define coff_bfd_reloc_name_lookup mcore_coff_reloc_name_lookup
548
#define coff_relocate_section      coff_mcore_relocate_section
549
#define coff_rtype_to_howto      coff_mcore_rtype_to_howto
550
551
1
#define SELECT_RELOC(internal, howto) {internal.r_type = howto->type;}
552
553
/* Make sure that the 'r_offset' field is copied properly
554
   so that identical binaries will compare the same.  */
555
5.24k
#define SWAP_IN_RELOC_OFFSET       H_GET_32
556
1
#define SWAP_OUT_RELOC_OFFSET      H_PUT_32
557
558
127
#define COFF_PAGE_SIZE         0x1000
559
560
#include "coffcode.h"
561

562
/* Forward declaration to initialise alternative_target field.  */
563
extern const bfd_target TARGET_LITTLE_SYM;
564
565
/* The transfer vectors that lead the outside world to all of the above.  */
566
CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED,
567
          SEC_DEBUGGING,
568
          0, & TARGET_LITTLE_SYM, COFF_SWAP_TABLE)
569
CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED,
570
             SEC_DEBUGGING,
571
             0, & TARGET_BIG_SYM, COFF_SWAP_TABLE)