Coverage Report

Created: 2024-05-21 06:29

/src/binutils-gdb/bfd/coff-aarch64.c
Line
Count
Source (jump to first uncovered line)
1
/* BFD back-end for AArch64 COFF files.
2
   Copyright (C) 2021-2024 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, Inc., 51 Franklin Street - Fifth Floor, Boston,
19
   MA 02110-1301, USA.  */
20
21
22
#ifndef COFF_WITH_peAArch64
23
#define COFF_WITH_peAArch64
24
#endif
25
26
#include "sysdep.h"
27
#include "bfd.h"
28
#include "libbfd.h"
29
#include "coff/aarch64.h"
30
#include "coff/internal.h"
31
#include "coff/pe.h"
32
#include "libcoff.h"
33
#include "libiberty.h"
34
35
/* For these howto special functions,
36
   output_bfd == NULL => final link, or objdump -W and other calls to
37
   bfd_simple_get_relocated_section_contents
38
   output_bfd != NULL && output_bfd != abfd => ld -r
39
   output_bfd != NULL && output_bfd == abfd => gas.
40
   FIXME: ld -r is punted to bfd_perform_relocation.  This won't be
41
   correct for cases where the addend needs to be adjusted, eg. for
42
   relocations against section symbols, and the field is split because
43
   bfd_perform_relocation can't write addends to split relocation fields.  */
44
45
static bfd_reloc_status_type
46
coff_aarch64_rel21_reloc (bfd *abfd,
47
        arelent *reloc_entry,
48
        asymbol *symbol,
49
        void *data,
50
        asection *input_section,
51
        bfd *output_bfd,
52
        char **error_message ATTRIBUTE_UNUSED)
53
0
{
54
0
  if (output_bfd != NULL && output_bfd != abfd)
55
0
    return bfd_reloc_continue;
56
57
0
  if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd,
58
0
          input_section, reloc_entry->address))
59
0
    return bfd_reloc_outofrange;
60
61
0
  uint32_t op = bfd_getl32 (data + reloc_entry->address);
62
0
  bfd_vma relocation = reloc_entry->addend;
63
0
  bfd_reloc_status_type ret = bfd_reloc_ok;
64
0
  if (output_bfd == NULL)
65
0
    {
66
0
      if (bfd_is_und_section (symbol->section))
67
0
  {
68
0
    if ((symbol->flags & BSF_WEAK) == 0)
69
0
      ret = bfd_reloc_undefined;
70
0
  }
71
0
      else if (!bfd_is_com_section (symbol->section))
72
0
  relocation += (symbol->value
73
0
           + symbol->section->output_offset
74
0
           + symbol->section->output_section->vma);
75
0
      bfd_vma addend = ((op >> 3) & 0x1ffffc) | ((op >> 29) & 0x3);
76
0
      addend = (addend ^ 0x100000) - 0x100000;
77
0
      relocation += addend;
78
0
      relocation -= (reloc_entry->address
79
0
         + input_section->output_offset
80
0
         + input_section->output_section->vma);
81
0
      relocation = (bfd_signed_vma) relocation >> reloc_entry->howto->rightshift;
82
0
    }
83
0
  if (relocation + 0x100000 > 0x1fffff)
84
0
    ret = bfd_reloc_overflow;
85
86
0
  op &= 0x9f00001f;
87
0
  op |= (relocation & 0x1ffffc) << 3;
88
0
  op |= (relocation & 0x3) << 29;
89
90
0
  bfd_putl32 (op, data + reloc_entry->address);
91
92
0
  return ret;
93
0
}
Unexecuted instantiation: pe-aarch64.c:coff_aarch64_rel21_reloc
Unexecuted instantiation: pei-aarch64.c:coff_aarch64_rel21_reloc
94
95
static bfd_reloc_status_type
96
coff_aarch64_po12l_reloc (bfd *abfd,
97
        arelent *reloc_entry,
98
        asymbol *symbol ATTRIBUTE_UNUSED,
99
        void *data,
100
        asection *input_section,
101
        bfd *output_bfd,
102
        char **error_message ATTRIBUTE_UNUSED)
103
0
{
104
0
  if (output_bfd != NULL && output_bfd != abfd)
105
0
    return bfd_reloc_continue;
106
107
0
  if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd,
108
0
          input_section, reloc_entry->address))
109
0
    return bfd_reloc_outofrange;
110
111
0
  uint32_t op = bfd_getl32 (data + reloc_entry->address);
112
0
  bfd_vma relocation = reloc_entry->addend & 0xfff;
113
0
  int shift;
114
115
0
  if ((op & 0xff800000) == 0x3d800000)
116
0
    {
117
      /* LDR / STR with q register */
118
0
      shift = 4;
119
0
    }
120
0
  else
121
0
    {
122
      /* top two bits represent how much addend should be shifted */
123
0
      shift = op >> 30;
124
0
    }
125
126
0
  bfd_reloc_status_type ret = bfd_reloc_ok;
127
0
  if (output_bfd == NULL)
128
0
    {
129
0
      if (bfd_is_und_section (symbol->section))
130
0
  {
131
0
    if ((symbol->flags & BSF_WEAK) == 0)
132
0
      ret = bfd_reloc_undefined;
133
0
  }
134
0
      else if (!bfd_is_com_section (symbol->section))
135
0
  relocation += (symbol->value
136
0
           + symbol->section->output_offset
137
0
           + symbol->section->output_section->vma);
138
0
      bfd_vma addend = (op >> 10) & 0xfff;
139
0
      addend <<= shift;
140
0
      relocation += addend;
141
0
    }
142
143
0
  if (relocation & ((1 << shift) - 1))
144
0
    ret = bfd_reloc_overflow;
145
146
0
  op &= 0xffc003ff;
147
0
  op |= (relocation >> shift << 10) & 0x3ffc00;
148
149
0
  bfd_putl32 (op, data + reloc_entry->address);
150
151
0
  return ret;
152
0
}
Unexecuted instantiation: pe-aarch64.c:coff_aarch64_po12l_reloc
Unexecuted instantiation: pei-aarch64.c:coff_aarch64_po12l_reloc
153
154
static bfd_reloc_status_type
155
coff_aarch64_addr32nb_reloc (bfd *abfd,
156
           arelent *reloc_entry,
157
           asymbol *symbol ATTRIBUTE_UNUSED,
158
           void *data,
159
           asection *input_section,
160
           bfd *output_bfd,
161
           char **error_message)
162
0
{
163
0
  if (output_bfd != NULL && output_bfd != abfd)
164
0
    return bfd_reloc_continue;
165
166
0
  if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd,
167
0
          input_section, reloc_entry->address))
168
0
    return bfd_reloc_outofrange;
169
170
0
  bfd_vma relocation = reloc_entry->addend;
171
0
  bfd_reloc_status_type ret = bfd_reloc_ok;
172
0
  if (output_bfd == NULL)
173
0
    {
174
0
      if (bfd_is_und_section (symbol->section))
175
0
  {
176
0
    if ((symbol->flags & BSF_WEAK) == 0)
177
0
      ret = bfd_reloc_undefined;
178
0
  }
179
0
      else if (!bfd_is_com_section (symbol->section))
180
0
  relocation += (symbol->value
181
0
           + symbol->section->output_offset
182
0
           + symbol->section->output_section->vma);
183
0
      bfd_vma addend = bfd_getl_signed_32 (data + reloc_entry->address);
184
0
      relocation += addend;
185
0
      bfd *obfd = input_section->output_section->owner;
186
0
      if (bfd_get_flavour (obfd) == bfd_target_coff_flavour
187
0
    && obj_pe (obfd))
188
0
  relocation -= pe_data (obfd)->pe_opthdr.ImageBase;
189
0
      else
190
0
  {
191
0
    *error_message = "unsupported";
192
0
    return bfd_reloc_dangerous;
193
0
  }
194
0
    }
195
196
0
  if (relocation + 0x80000000 > 0xffffffff)
197
0
    ret = bfd_reloc_overflow;
198
199
0
  bfd_putl32 (relocation, data + reloc_entry->address);
200
201
0
  return ret;
202
0
}
Unexecuted instantiation: pe-aarch64.c:coff_aarch64_addr32nb_reloc
Unexecuted instantiation: pei-aarch64.c:coff_aarch64_addr32nb_reloc
203
204
static bfd_reloc_status_type
205
coff_aarch64_secrel_reloc (bfd *abfd,
206
         arelent *reloc_entry,
207
         asymbol *symbol ATTRIBUTE_UNUSED,
208
         void *data,
209
         asection *input_section,
210
         bfd *output_bfd,
211
         char **error_message ATTRIBUTE_UNUSED)
212
0
{
213
0
  if (output_bfd != NULL && output_bfd != abfd)
214
0
    return bfd_reloc_continue;
215
216
0
  if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd,
217
0
          input_section, reloc_entry->address))
218
0
    return bfd_reloc_outofrange;
219
220
0
  bfd_vma relocation = reloc_entry->addend;
221
0
  bfd_reloc_status_type ret = bfd_reloc_ok;
222
0
  if (output_bfd == NULL)
223
0
    {
224
0
      if (bfd_is_und_section (symbol->section))
225
0
  {
226
0
    if ((symbol->flags & BSF_WEAK) == 0)
227
0
      ret = bfd_reloc_undefined;
228
0
  }
229
0
      else if (!bfd_is_com_section (symbol->section))
230
0
  relocation += (symbol->value
231
0
           + symbol->section->output_offset);
232
0
      bfd_vma addend = bfd_getl_signed_32 (data + reloc_entry->address);
233
0
      relocation += addend;
234
0
    }
235
0
  if (relocation > 0xffffffff)
236
0
    ret = bfd_reloc_overflow;
237
238
0
  bfd_putl32 (relocation, data + reloc_entry->address);
239
240
0
  return ret;
241
0
}
Unexecuted instantiation: pe-aarch64.c:coff_aarch64_secrel_reloc
Unexecuted instantiation: pei-aarch64.c:coff_aarch64_secrel_reloc
242
243
#define coff_aarch64_NULL NULL
244
#undef HOWTO_INSTALL_ADDEND
245
#define HOWTO_INSTALL_ADDEND 1
246
#define HOW(type, right, size, bits, pcrel, left, ovf, func, mask) \
247
  HOWTO (type, right, size, bits, pcrel, left, complain_overflow_##ovf, \
248
   coff_aarch64_##func, #type, true, mask, mask, false)
249
250
static const reloc_howto_type arm64_reloc_howto_abs
251
= HOW (IMAGE_REL_ARM64_ABSOLUTE,
252
       0, 0, 0, false, 0, dont, NULL, 0);
253
254
static const reloc_howto_type arm64_reloc_howto_64
255
= HOW (IMAGE_REL_ARM64_ADDR64,
256
       0, 8, 64, false, 0, dont, NULL, UINT64_C (-1));
257
258
static const reloc_howto_type arm64_reloc_howto_32
259
= HOW (IMAGE_REL_ARM64_ADDR32,
260
       0, 4, 32, false, 0, signed, NULL, 0xffffffff);
261
262
static const reloc_howto_type arm64_reloc_howto_32_pcrel
263
= HOW (IMAGE_REL_ARM64_REL32,
264
       0, 4, 32, true, 0, signed, NULL, 0xffffffff);
265
266
static const reloc_howto_type arm64_reloc_howto_branch26
267
= HOW (IMAGE_REL_ARM64_BRANCH26,
268
       2, 4, 26, true, 0, signed, NULL, 0x3ffffff);
269
270
static const reloc_howto_type arm64_reloc_howto_page21
271
= HOW (IMAGE_REL_ARM64_PAGEBASE_REL21,
272
       12, 4, 21, true, 0, signed, rel21_reloc, 0x1fffff);
273
274
static const reloc_howto_type arm64_reloc_howto_lo21
275
= HOW (IMAGE_REL_ARM64_REL21,
276
       0, 4, 21, true, 0, signed, rel21_reloc, 0x1fffff);
277
278
static const reloc_howto_type arm64_reloc_howto_pgoff12l
279
= HOW (IMAGE_REL_ARM64_PAGEOFFSET_12L,
280
       0, 4, 12, true, 10, signed, po12l_reloc, 0x3ffc00);
281
282
static const reloc_howto_type arm64_reloc_howto_branch19
283
= HOW (IMAGE_REL_ARM64_BRANCH19,
284
       2, 4, 19, true, 5, signed, NULL, 0xffffe0);
285
286
static const reloc_howto_type arm64_reloc_howto_branch14
287
= HOW (IMAGE_REL_ARM64_BRANCH14,
288
       2, 4, 14, true, 5, signed, NULL, 0x7ffe0);
289
290
static const reloc_howto_type arm64_reloc_howto_pgoff12a
291
= HOW (IMAGE_REL_ARM64_PAGEOFFSET_12A,
292
       0, 4, 12, true, 10, dont, NULL, 0x3ffc00);
293
294
static const reloc_howto_type arm64_reloc_howto_32nb
295
= HOW (IMAGE_REL_ARM64_ADDR32NB,
296
       0, 4, 32, false, 0, signed, addr32nb_reloc, 0xffffffff);
297
298
static const reloc_howto_type arm64_reloc_howto_secrel
299
= HOW (IMAGE_REL_ARM64_SECREL,
300
       0, 4, 32, false, 0, dont, secrel_reloc, 0xffffffff);
301
302
static const reloc_howto_type arm64_reloc_howto_secidx
303
= HOW (IMAGE_REL_ARM64_SECTION,
304
       0, 2, 16, false, 0, dont, NULL, 0xffff);
305
306
static const reloc_howto_type* const arm64_howto_table[] = {
307
     &arm64_reloc_howto_abs,
308
     &arm64_reloc_howto_64,
309
     &arm64_reloc_howto_32,
310
     &arm64_reloc_howto_32_pcrel,
311
     &arm64_reloc_howto_branch26,
312
     &arm64_reloc_howto_page21,
313
     &arm64_reloc_howto_lo21,
314
     &arm64_reloc_howto_pgoff12l,
315
     &arm64_reloc_howto_branch19,
316
     &arm64_reloc_howto_branch14,
317
     &arm64_reloc_howto_pgoff12a,
318
     &arm64_reloc_howto_32nb,
319
     &arm64_reloc_howto_secrel,
320
     &arm64_reloc_howto_secidx
321
};
322
323
/* No adjustment to addends should be needed.  The actual relocation
324
   addend is in the section contents.  Unfortunately this means actual
325
   addends are not shown by objdump -r, but that's true for most
326
   COFF/PE targets where arelent.addend is an adjustment.  */
327
#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr)    \
328
6.51k
  cache_ptr->addend = 0;
329
330
#ifndef NUM_ELEM
331
0
#define NUM_ELEM(a) ((sizeof (a)) / sizeof ((a)[0]))
332
#endif
333
334
0
#define NUM_RELOCS NUM_ELEM (arm64_howto_table)
335
336
#define coff_bfd_reloc_type_lookup    coff_aarch64_reloc_type_lookup
337
#define coff_bfd_reloc_name_lookup    coff_aarch64_reloc_name_lookup
338
339
static reloc_howto_type *
340
coff_aarch64_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code)
341
6.42k
{
342
6.42k
  switch (code)
343
6.42k
  {
344
0
  case BFD_RELOC_64:
345
0
    return &arm64_reloc_howto_64;
346
1.58k
  case BFD_RELOC_32:
347
1.58k
    return &arm64_reloc_howto_32;
348
0
  case BFD_RELOC_32_PCREL:
349
0
    return &arm64_reloc_howto_32_pcrel;
350
0
  case BFD_RELOC_AARCH64_CALL26:
351
0
  case BFD_RELOC_AARCH64_JUMP26:
352
0
    return &arm64_reloc_howto_branch26;
353
0
  case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
354
0
  case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
355
0
  case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
356
0
    return &arm64_reloc_howto_page21;
357
0
  case BFD_RELOC_AARCH64_TSTBR14:
358
0
    return &arm64_reloc_howto_branch14;
359
0
  case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
360
0
    return &arm64_reloc_howto_lo21;
361
0
  case BFD_RELOC_AARCH64_ADD_LO12:
362
0
    return &arm64_reloc_howto_pgoff12a;
363
0
  case BFD_RELOC_AARCH64_LDST8_LO12:
364
0
  case BFD_RELOC_AARCH64_LDST16_LO12:
365
0
  case BFD_RELOC_AARCH64_LDST32_LO12:
366
0
  case BFD_RELOC_AARCH64_LDST64_LO12:
367
0
  case BFD_RELOC_AARCH64_LDST128_LO12:
368
0
  case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
369
0
    return &arm64_reloc_howto_pgoff12l;
370
0
  case BFD_RELOC_AARCH64_BRANCH19:
371
0
    return &arm64_reloc_howto_branch19;
372
4.84k
  case BFD_RELOC_RVA:
373
4.84k
    return &arm64_reloc_howto_32nb;
374
0
  case BFD_RELOC_32_SECREL:
375
0
    return &arm64_reloc_howto_secrel;
376
0
  case BFD_RELOC_16_SECIDX:
377
0
    return &arm64_reloc_howto_secidx;
378
0
  default:
379
0
    BFD_FAIL ();
380
0
    return NULL;
381
6.42k
  }
382
383
0
  return NULL;
384
6.42k
}
Unexecuted instantiation: pe-aarch64.c:coff_aarch64_reloc_type_lookup
pei-aarch64.c:coff_aarch64_reloc_type_lookup
Line
Count
Source
341
6.42k
{
342
6.42k
  switch (code)
343
6.42k
  {
344
0
  case BFD_RELOC_64:
345
0
    return &arm64_reloc_howto_64;
346
1.58k
  case BFD_RELOC_32:
347
1.58k
    return &arm64_reloc_howto_32;
348
0
  case BFD_RELOC_32_PCREL:
349
0
    return &arm64_reloc_howto_32_pcrel;
350
0
  case BFD_RELOC_AARCH64_CALL26:
351
0
  case BFD_RELOC_AARCH64_JUMP26:
352
0
    return &arm64_reloc_howto_branch26;
353
0
  case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
354
0
  case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
355
0
  case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
356
0
    return &arm64_reloc_howto_page21;
357
0
  case BFD_RELOC_AARCH64_TSTBR14:
358
0
    return &arm64_reloc_howto_branch14;
359
0
  case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
360
0
    return &arm64_reloc_howto_lo21;
361
0
  case BFD_RELOC_AARCH64_ADD_LO12:
362
0
    return &arm64_reloc_howto_pgoff12a;
363
0
  case BFD_RELOC_AARCH64_LDST8_LO12:
364
0
  case BFD_RELOC_AARCH64_LDST16_LO12:
365
0
  case BFD_RELOC_AARCH64_LDST32_LO12:
366
0
  case BFD_RELOC_AARCH64_LDST64_LO12:
367
0
  case BFD_RELOC_AARCH64_LDST128_LO12:
368
0
  case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
369
0
    return &arm64_reloc_howto_pgoff12l;
370
0
  case BFD_RELOC_AARCH64_BRANCH19:
371
0
    return &arm64_reloc_howto_branch19;
372
4.84k
  case BFD_RELOC_RVA:
373
4.84k
    return &arm64_reloc_howto_32nb;
374
0
  case BFD_RELOC_32_SECREL:
375
0
    return &arm64_reloc_howto_secrel;
376
0
  case BFD_RELOC_16_SECIDX:
377
0
    return &arm64_reloc_howto_secidx;
378
0
  default:
379
0
    BFD_FAIL ();
380
0
    return NULL;
381
6.42k
  }
382
383
0
  return NULL;
384
6.42k
}
385
386
static reloc_howto_type *
387
coff_aarch64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
388
          const char *r_name)
389
0
{
390
0
  unsigned int i;
391
392
0
  for (i = 0; i < NUM_RELOCS; i++)
393
0
    if (arm64_howto_table[i]->name != NULL
394
0
      && strcasecmp (arm64_howto_table[i]->name, r_name) == 0)
395
0
      return arm64_howto_table[i];
396
397
0
  return NULL;
398
0
}
Unexecuted instantiation: pe-aarch64.c:coff_aarch64_reloc_name_lookup
Unexecuted instantiation: pei-aarch64.c:coff_aarch64_reloc_name_lookup
399
400
559k
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER  2
401
0
#define COFF_PAGE_SIZE            0x1000
402
403
static reloc_howto_type *
404
coff_aarch64_rtype_lookup (unsigned int code)
405
6.51k
{
406
6.51k
  switch (code)
407
6.51k
  {
408
5.37k
    case IMAGE_REL_ARM64_ABSOLUTE:
409
5.37k
      return &arm64_reloc_howto_abs;
410
1
    case IMAGE_REL_ARM64_ADDR64:
411
1
      return &arm64_reloc_howto_64;
412
43
    case IMAGE_REL_ARM64_ADDR32:
413
43
      return &arm64_reloc_howto_32;
414
15
    case IMAGE_REL_ARM64_REL32:
415
15
      return &arm64_reloc_howto_32_pcrel;
416
1
    case IMAGE_REL_ARM64_BRANCH26:
417
1
      return &arm64_reloc_howto_branch26;
418
3
    case IMAGE_REL_ARM64_PAGEBASE_REL21:
419
3
      return &arm64_reloc_howto_page21;
420
10
    case IMAGE_REL_ARM64_REL21:
421
10
      return &arm64_reloc_howto_lo21;
422
25
    case IMAGE_REL_ARM64_PAGEOFFSET_12L:
423
25
      return &arm64_reloc_howto_pgoff12l;
424
16
    case IMAGE_REL_ARM64_BRANCH19:
425
16
      return &arm64_reloc_howto_branch19;
426
108
    case IMAGE_REL_ARM64_BRANCH14:
427
108
      return &arm64_reloc_howto_branch14;
428
19
    case IMAGE_REL_ARM64_PAGEOFFSET_12A:
429
19
      return &arm64_reloc_howto_pgoff12a;
430
113
    case IMAGE_REL_ARM64_ADDR32NB:
431
113
      return &arm64_reloc_howto_32nb;
432
59
    case IMAGE_REL_ARM64_SECREL:
433
59
      return &arm64_reloc_howto_secrel;
434
20
    case IMAGE_REL_ARM64_SECTION:
435
20
      return &arm64_reloc_howto_secidx;
436
702
    default:
437
702
      return NULL;
438
6.51k
  }
439
440
0
  return NULL;
441
6.51k
}
pe-aarch64.c:coff_aarch64_rtype_lookup
Line
Count
Source
405
6.51k
{
406
6.51k
  switch (code)
407
6.51k
  {
408
5.37k
    case IMAGE_REL_ARM64_ABSOLUTE:
409
5.37k
      return &arm64_reloc_howto_abs;
410
1
    case IMAGE_REL_ARM64_ADDR64:
411
1
      return &arm64_reloc_howto_64;
412
43
    case IMAGE_REL_ARM64_ADDR32:
413
43
      return &arm64_reloc_howto_32;
414
15
    case IMAGE_REL_ARM64_REL32:
415
15
      return &arm64_reloc_howto_32_pcrel;
416
1
    case IMAGE_REL_ARM64_BRANCH26:
417
1
      return &arm64_reloc_howto_branch26;
418
3
    case IMAGE_REL_ARM64_PAGEBASE_REL21:
419
3
      return &arm64_reloc_howto_page21;
420
10
    case IMAGE_REL_ARM64_REL21:
421
10
      return &arm64_reloc_howto_lo21;
422
25
    case IMAGE_REL_ARM64_PAGEOFFSET_12L:
423
25
      return &arm64_reloc_howto_pgoff12l;
424
16
    case IMAGE_REL_ARM64_BRANCH19:
425
16
      return &arm64_reloc_howto_branch19;
426
108
    case IMAGE_REL_ARM64_BRANCH14:
427
108
      return &arm64_reloc_howto_branch14;
428
19
    case IMAGE_REL_ARM64_PAGEOFFSET_12A:
429
19
      return &arm64_reloc_howto_pgoff12a;
430
113
    case IMAGE_REL_ARM64_ADDR32NB:
431
113
      return &arm64_reloc_howto_32nb;
432
59
    case IMAGE_REL_ARM64_SECREL:
433
59
      return &arm64_reloc_howto_secrel;
434
20
    case IMAGE_REL_ARM64_SECTION:
435
20
      return &arm64_reloc_howto_secidx;
436
702
    default:
437
702
      return NULL;
438
6.51k
  }
439
440
0
  return NULL;
441
6.51k
}
Unexecuted instantiation: pei-aarch64.c:coff_aarch64_rtype_lookup
442
443
#define RTYPE2HOWTO(cache_ptr, dst)         \
444
6.51k
  ((cache_ptr)->howto = coff_aarch64_rtype_lookup((dst)->r_type))
445
446
static reloc_howto_type *
447
coff_aarch64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
448
           asection *sec ATTRIBUTE_UNUSED,
449
           struct internal_reloc *rel,
450
           struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
451
           struct internal_syment *sym ATTRIBUTE_UNUSED,
452
           bfd_vma *addendp)
453
0
{
454
0
  reloc_howto_type *howto = coff_aarch64_rtype_lookup (rel->r_type);
455
456
  /* Cancel out code in _bfd_coff_generic_relocate_section.  */
457
0
  *addendp = 0;
458
459
0
  return howto;
460
0
}
Unexecuted instantiation: pe-aarch64.c:coff_aarch64_rtype_to_howto
Unexecuted instantiation: pei-aarch64.c:coff_aarch64_rtype_to_howto
461
462
#define coff_rtype_to_howto coff_aarch64_rtype_to_howto
463
464
0
#define SELECT_RELOC(x,howto) { (x).r_type = (howto)->type; }
465
466
#ifndef bfd_pe_print_pdata
467
#define bfd_pe_print_pdata      NULL
468
#endif
469
470
#ifdef COFF_WITH_PE
471
/* Return TRUE if this relocation should
472
   appear in the output .reloc section.  */
473
474
static bool
475
in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED,
476
            reloc_howto_type * howto)
477
0
{
478
0
  return !howto->pc_relative;
479
0
}
Unexecuted instantiation: pe-aarch64.c:in_reloc_p
Unexecuted instantiation: pei-aarch64.c:in_reloc_p
480
#endif
481
482
static bool
483
coff_pe_aarch64_relocate_section (bfd *output_bfd,
484
          struct bfd_link_info *info,
485
          bfd *input_bfd,
486
          asection *input_section,
487
          bfd_byte *contents,
488
          struct internal_reloc *relocs,
489
          struct internal_syment *syms,
490
          asection **sections)
491
0
{
492
0
  struct internal_reloc *rel;
493
0
  struct internal_reloc *relend;
494
495
0
  if (bfd_link_relocatable (info))
496
0
    return true;
497
498
0
  rel = relocs;
499
0
  relend = rel + input_section->reloc_count;
500
501
  /* The addend for a relocation is stored in the immediate bits of each
502
     opcode.  So for each relocation, we need to extract the immediate value,
503
     use this to calculate what it should be for the symbol, and rewrite the
504
     opcode into the section stream.  */
505
506
0
  for (; rel < relend; rel++)
507
0
    {
508
0
      long symndx;
509
0
      struct coff_link_hash_entry *h;
510
0
      bfd_vma sym_value;
511
0
      asection *sec = NULL;
512
0
      uint64_t dest_vma;
513
514
      /* skip trivial relocations */
515
0
      if (rel->r_type == IMAGE_REL_ARM64_ADDR32
516
0
    || rel->r_type == IMAGE_REL_ARM64_ADDR64
517
0
    || rel->r_type == IMAGE_REL_ARM64_ABSOLUTE)
518
0
  continue;
519
520
0
      symndx = rel->r_symndx;
521
0
      sym_value = syms[symndx].n_value;
522
523
0
      h = obj_coff_sym_hashes (input_bfd)[symndx];
524
525
0
      if (h && h->root.type == bfd_link_hash_defined)
526
0
  {
527
0
    sec = h->root.u.def.section;
528
0
    sym_value = h->root.u.def.value;
529
0
  }
530
0
      else
531
0
  {
532
0
    sec = sections[symndx];
533
0
  }
534
535
0
      if (!sec)
536
0
  continue;
537
538
0
      if (bfd_is_und_section (sec))
539
0
  continue;
540
541
0
      if (discarded_section (sec))
542
0
  continue;
543
544
0
      dest_vma = sec->output_section->vma + sec->output_offset + sym_value;
545
546
0
      if (symndx < 0
547
0
    || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
548
0
  continue;
549
550
      /* All the relocs handled below operate on 4 bytes.  */
551
0
      if (input_section->size < rel->r_vaddr
552
0
    || input_section->size - rel->r_vaddr < 4)
553
0
  {
554
0
    _bfd_error_handler
555
      /* xgettext: c-format */
556
0
      (_("%pB: bad reloc address %#" PRIx64 " in section `%pA'"),
557
0
       input_bfd, (uint64_t) rel->r_vaddr, input_section);
558
0
    continue;
559
0
  }
560
561
0
      switch (rel->r_type)
562
0
  {
563
0
  case IMAGE_REL_ARM64_ADDR32NB:
564
0
    {
565
0
      uint64_t val;
566
0
      int32_t addend;
567
568
0
      addend = bfd_getl32 (contents + rel->r_vaddr);
569
570
0
      dest_vma += addend;
571
572
0
      val = dest_vma;
573
0
      val -= pe_data (output_bfd)->pe_opthdr.ImageBase;
574
575
0
      if (val > 0xffffffff)
576
0
        (*info->callbacks->reloc_overflow)
577
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
578
0
    "IMAGE_REL_ARM64_ADDR32NB", addend, input_bfd,
579
0
    input_section, rel->r_vaddr - input_section->vma);
580
581
0
      bfd_putl32 (val, contents + rel->r_vaddr);
582
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
583
584
0
      break;
585
0
    }
586
587
0
  case IMAGE_REL_ARM64_BRANCH26:
588
0
    {
589
0
      uint64_t cur_vma;
590
0
      uint32_t opcode;
591
0
      int64_t addend, val;
592
593
0
      opcode = bfd_getl32 (contents + rel->r_vaddr);
594
595
0
      addend = (opcode & 0x3ffffff) << 2;
596
597
0
      if (addend & 0x8000000)
598
0
        addend |= 0xfffffffff0000000;
599
600
0
      dest_vma += addend;
601
0
      cur_vma = input_section->output_section->vma
602
0
          + input_section->output_offset
603
0
          + rel->r_vaddr;
604
605
0
      val = (dest_vma >> 2) - (cur_vma >> 2);
606
607
0
      if (val > 0x1ffffff || val < -0x2000000)
608
0
        (*info->callbacks->reloc_overflow)
609
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
610
0
    "IMAGE_REL_ARM64_BRANCH26", addend, input_bfd,
611
0
    input_section, rel->r_vaddr - input_section->vma);
612
613
0
      opcode &= 0xfc000000;
614
0
      opcode |= val & 0x3ffffff;
615
616
0
      bfd_putl32 (opcode, contents + rel->r_vaddr);
617
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
618
619
0
      break;
620
0
    }
621
622
0
  case IMAGE_REL_ARM64_BRANCH19:
623
0
    {
624
0
      uint64_t cur_vma;
625
0
      uint32_t opcode;
626
0
      int64_t addend, val;
627
628
0
      opcode = bfd_getl32 (contents + rel->r_vaddr);
629
630
0
      addend = (opcode & 0xffffe0) >> 3;
631
632
0
      if (addend & 0x100000)
633
0
        addend |= 0xffffffffffe00000;
634
635
0
      dest_vma += addend;
636
0
      cur_vma = input_section->output_section->vma
637
0
          + input_section->output_offset
638
0
          + rel->r_vaddr;
639
640
0
      val = (dest_vma >> 2) - (cur_vma >> 2);
641
642
0
      if (val > 0x3ffff || val < -0x40000)
643
0
        (*info->callbacks->reloc_overflow)
644
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
645
0
    "IMAGE_REL_ARM64_BRANCH19", addend, input_bfd,
646
0
    input_section, rel->r_vaddr - input_section->vma);
647
648
0
      opcode &= 0xff00001f;
649
0
      opcode |= (val & 0x7ffff) << 5;
650
651
0
      bfd_putl32 (opcode, contents + rel->r_vaddr);
652
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
653
654
0
      break;
655
0
    }
656
657
0
  case IMAGE_REL_ARM64_BRANCH14:
658
0
    {
659
0
      uint64_t cur_vma;
660
0
      uint32_t opcode;
661
0
      int64_t addend, val;
662
663
0
      opcode = bfd_getl32 (contents + rel->r_vaddr);
664
665
0
      addend = (opcode & 0x7ffe0) >> 3;
666
667
0
      if (addend & 0x8000)
668
0
        addend |= 0xffffffffffff0000;
669
670
0
      dest_vma += addend;
671
0
      cur_vma = input_section->output_section->vma
672
0
          + input_section->output_offset
673
0
          + rel->r_vaddr;
674
675
0
      val = (dest_vma >> 2) - (cur_vma >> 2);
676
677
0
      if (val > 0x1fff || val < -0x2000)
678
0
        (*info->callbacks->reloc_overflow)
679
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
680
0
    "IMAGE_REL_ARM64_BRANCH14", addend, input_bfd,
681
0
    input_section, rel->r_vaddr - input_section->vma);
682
683
0
      opcode &= 0xfff8001f;
684
0
      opcode |= (val & 0x3fff) << 5;
685
686
0
      bfd_putl32 (opcode, contents + rel->r_vaddr);
687
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
688
689
0
      break;
690
0
    }
691
692
0
  case IMAGE_REL_ARM64_PAGEBASE_REL21:
693
0
    {
694
0
      uint64_t cur_vma;
695
0
      uint32_t opcode;
696
0
      int64_t addend, val;
697
698
0
      opcode = bfd_getl32 (contents + rel->r_vaddr);
699
700
0
      addend = ((opcode & 0xffffe0) >> 3)
701
0
         | ((opcode & 0x60000000) >> 29);
702
703
0
      if (addend & 0x100000)
704
0
        addend |= 0xffffffffffe00000;
705
706
0
      dest_vma += addend;
707
0
      cur_vma = input_section->output_section->vma
708
0
          + input_section->output_offset
709
0
          + rel->r_vaddr;
710
711
0
      val = (dest_vma >> 12) - (cur_vma >> 12);
712
713
0
      if (val > 0xfffff || val < -0x100000)
714
0
        (*info->callbacks->reloc_overflow)
715
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
716
0
    "IMAGE_REL_ARM64_PAGEBASE_REL21", addend, input_bfd,
717
0
    input_section, rel->r_vaddr - input_section->vma);
718
719
0
      opcode &= 0x9f00001f;
720
0
      opcode |= (val & 0x3) << 29;
721
0
      opcode |= (val & 0x1ffffc) << 3;
722
723
0
      bfd_putl32 (opcode, contents + rel->r_vaddr);
724
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
725
726
0
      break;
727
0
    }
728
729
0
  case IMAGE_REL_ARM64_REL21:
730
0
    {
731
0
      uint64_t cur_vma;
732
0
      uint32_t opcode;
733
0
      int64_t addend, val;
734
735
0
      opcode = bfd_getl32 (contents + rel->r_vaddr);
736
737
0
      addend = ((opcode & 0xffffe0) >> 3)
738
0
         | ((opcode & 0x60000000) >> 29);
739
740
0
      if (addend & 0x100000)
741
0
        addend |= 0xffffffffffe00000;
742
743
0
      dest_vma += addend;
744
0
      cur_vma = input_section->output_section->vma
745
0
          + input_section->output_offset
746
0
          + rel->r_vaddr;
747
748
0
      val = dest_vma - cur_vma;
749
750
0
      if (val > 0xfffff || val < -0x100000)
751
0
        (*info->callbacks->reloc_overflow)
752
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
753
0
    "IMAGE_REL_ARM64_REL21", addend, input_bfd,
754
0
    input_section, rel->r_vaddr - input_section->vma);
755
756
0
      opcode &= 0x9f00001f;
757
0
      opcode |= (val & 0x3) << 29;
758
0
      opcode |= (val & 0x1ffffc) << 3;
759
760
0
      bfd_putl32 (opcode, contents + rel->r_vaddr);
761
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
762
763
0
      break;
764
0
    }
765
766
0
  case IMAGE_REL_ARM64_REL32:
767
0
    {
768
0
      uint64_t cur_vma;
769
0
      int64_t addend, val;
770
771
0
      addend = bfd_getl32 (contents + rel->r_vaddr);
772
773
0
      if (addend & 0x80000000)
774
0
        addend |= 0xffffffff00000000;
775
776
0
      dest_vma += addend;
777
0
      cur_vma = input_section->output_section->vma
778
0
          + input_section->output_offset
779
0
          + rel->r_vaddr;
780
781
0
      val = dest_vma - cur_vma;
782
783
0
      if (val > 0xffffffff || val < -0x100000000)
784
0
        (*info->callbacks->reloc_overflow)
785
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
786
0
    "IMAGE_REL_ARM64_REL32", addend, input_bfd,
787
0
    input_section, rel->r_vaddr - input_section->vma);
788
789
0
      bfd_putl32 (val, contents + rel->r_vaddr);
790
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
791
792
0
      break;
793
0
    }
794
795
0
  case IMAGE_REL_ARM64_PAGEOFFSET_12L:
796
0
    {
797
0
      uint32_t opcode, val;
798
0
      uint8_t shift;
799
0
      int32_t addend;
800
801
0
      opcode = bfd_getl32 (contents + rel->r_vaddr);
802
803
0
      addend = (opcode & 0x3ffc00) >> 10;
804
805
0
      if ((opcode & 0xff800000) == 0x3d800000)
806
0
        {
807
    /* LDR / STR with q register */
808
0
    shift = 4;
809
0
        }
810
0
      else
811
0
        {
812
    /* top two bits represent how much addend should be shifted */
813
0
    shift = opcode >> 30;
814
0
        }
815
816
0
      addend <<= shift;
817
818
0
      dest_vma += addend;
819
820
      /* only interested in bottom 12 bits */
821
0
      val = dest_vma & 0xfff;
822
823
0
      if (val & ((1 << shift) - 1))
824
0
        (*info->callbacks->reloc_overflow)
825
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
826
0
    "IMAGE_REL_ARM64_PAGEOFFSET_12L", addend, input_bfd,
827
0
    input_section, rel->r_vaddr - input_section->vma);
828
829
0
      val >>= shift;
830
831
0
      opcode &= 0xffc003ff;
832
0
      opcode |= val << 10;
833
834
0
      bfd_putl32 (opcode, contents + rel->r_vaddr);
835
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
836
837
0
      break;
838
0
    }
839
840
0
  case IMAGE_REL_ARM64_PAGEOFFSET_12A:
841
0
    {
842
0
      uint32_t opcode, val;
843
0
      int32_t addend;
844
845
0
      opcode = bfd_getl32 (contents + rel->r_vaddr);
846
847
0
      addend = (opcode & 0x3ffc00) >> 10;
848
849
0
      dest_vma += addend;
850
851
      /* only interested in bottom 12 bits */
852
0
      val = dest_vma & 0xfff;
853
854
0
      opcode &= 0xffc003ff;
855
0
      opcode |= val << 10;
856
857
0
      bfd_putl32 (opcode, contents + rel->r_vaddr);
858
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
859
860
0
      break;
861
0
    }
862
863
0
  case IMAGE_REL_ARM64_SECREL:
864
0
    {
865
0
      uint64_t val;
866
0
      int32_t addend;
867
868
0
      addend = bfd_getl32 (contents + rel->r_vaddr);
869
870
0
      val = sec->output_offset + sym_value + addend;
871
872
0
      if (val > 0xffffffff)
873
0
        (*info->callbacks->reloc_overflow)
874
0
    (info, h ? &h->root : NULL, syms[symndx]._n._n_name,
875
0
    "IMAGE_REL_ARM64_SECREL", addend, input_bfd,
876
0
    input_section, rel->r_vaddr - input_section->vma);
877
878
0
      bfd_putl32 (val, contents + rel->r_vaddr);
879
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
880
881
0
      break;
882
0
    }
883
884
0
  case IMAGE_REL_ARM64_SECTION:
885
0
    {
886
0
      uint16_t idx = 0, i = 1;
887
0
      asection *s;
888
889
0
      s = output_bfd->sections;
890
0
      while (s)
891
0
        {
892
0
    if (s == sec->output_section)
893
0
      {
894
0
        idx = i;
895
0
        break;
896
0
      }
897
898
0
    i++;
899
0
    s = s->next;
900
0
        }
901
902
903
0
      bfd_putl16 (idx, contents + rel->r_vaddr);
904
0
      rel->r_type = IMAGE_REL_ARM64_ABSOLUTE;
905
906
0
      break;
907
0
    }
908
909
0
  default:
910
0
    info->callbacks->einfo (_("%F%P: Unhandled relocation type %u\n"),
911
0
          rel->r_type);
912
0
    BFD_FAIL ();
913
0
    return false;
914
0
  }
915
0
    }
916
917
0
  return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
918
0
               input_section, contents,
919
0
               relocs, syms, sections);
920
0
}
Unexecuted instantiation: pe-aarch64.c:coff_pe_aarch64_relocate_section
Unexecuted instantiation: pei-aarch64.c:coff_pe_aarch64_relocate_section
921
922
#define coff_relocate_section coff_pe_aarch64_relocate_section
923
924
#include "coffcode.h"
925
926
/* Prevent assertion in md_apply_fix by forcing use_rela_p on for new
927
   sections.  */
928
static bool
929
coff_aarch64_new_section_hook (bfd *abfd, asection *section)
930
279k
{
931
279k
  if (!coff_new_section_hook (abfd, section))
932
0
    return false;
933
934
279k
  section->use_rela_p = 1;
935
936
279k
  return true;
937
279k
}
pe-aarch64.c:coff_aarch64_new_section_hook
Line
Count
Source
930
114k
{
931
114k
  if (!coff_new_section_hook (abfd, section))
932
0
    return false;
933
934
114k
  section->use_rela_p = 1;
935
936
114k
  return true;
937
114k
}
pei-aarch64.c:coff_aarch64_new_section_hook
Line
Count
Source
930
165k
{
931
165k
  if (!coff_new_section_hook (abfd, section))
932
0
    return false;
933
934
165k
  section->use_rela_p = 1;
935
936
165k
  return true;
937
165k
}
938
939
#define coff_aarch64_close_and_cleanup coff_close_and_cleanup
940
#define coff_aarch64_bfd_free_cached_info coff_bfd_free_cached_info
941
#define coff_aarch64_get_section_contents coff_get_section_contents
942
943
/* Target vectors.  */
944
const bfd_target
945
#ifdef TARGET_SYM
946
  TARGET_SYM =
947
#else
948
# error "target symbol name not specified"
949
#endif
950
{
951
#ifdef TARGET_NAME
952
  TARGET_NAME,
953
#else
954
# error "target name not specified"
955
#endif
956
  bfd_target_coff_flavour,
957
  BFD_ENDIAN_LITTLE,    /* Data byte order is little.  */
958
  BFD_ENDIAN_LITTLE,    /* Header byte order is little.  */
959
960
  (HAS_RELOC | EXEC_P   /* Object flags.  */
961
   | HAS_LINENO | HAS_DEBUG
962
   | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS),
963
964
  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags.  */
965
#if defined(COFF_WITH_PE)
966
   | SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY | SEC_DEBUGGING
967
#endif
968
   | SEC_CODE | SEC_DATA | SEC_EXCLUDE ),
969
970
#ifdef TARGET_UNDERSCORE
971
  TARGET_UNDERSCORE,    /* Leading underscore.  */
972
#else
973
  0,        /* Leading underscore.  */
974
#endif
975
  '/',        /* Ar_pad_char.  */
976
  15,       /* Ar_max_namelen.  */
977
  0,        /* match priority.  */
978
  TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols.  */
979
980
  /* Data conversion functions.  */
981
  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
982
  bfd_getl32, bfd_getl_signed_32, bfd_putl32,
983
  bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data.  */
984
  /* Header conversion functions.  */
985
  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
986
  bfd_getl32, bfd_getl_signed_32, bfd_putl32,
987
  bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Hdrs.  */
988
989
  /* Note that we allow an object file to be treated as a core file as well.  */
990
  {       /* bfd_check_format.  */
991
    _bfd_dummy_target,
992
    coff_object_p,
993
    bfd_generic_archive_p,
994
    coff_object_p
995
  },
996
  {       /* bfd_set_format.  */
997
    _bfd_bool_bfd_false_error,
998
    coff_mkobject,
999
    _bfd_generic_mkarchive,
1000
    _bfd_bool_bfd_false_error
1001
  },
1002
  {       /* bfd_write_contents.  */
1003
    _bfd_bool_bfd_false_error,
1004
    coff_write_object_contents,
1005
    _bfd_write_archive_contents,
1006
    _bfd_bool_bfd_false_error
1007
  },
1008
1009
  BFD_JUMP_TABLE_GENERIC (coff_aarch64),
1010
  BFD_JUMP_TABLE_COPY (coff),
1011
  BFD_JUMP_TABLE_CORE (_bfd_nocore),
1012
  BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
1013
  BFD_JUMP_TABLE_SYMBOLS (coff),
1014
  BFD_JUMP_TABLE_RELOCS (coff),
1015
  BFD_JUMP_TABLE_WRITE (coff),
1016
  BFD_JUMP_TABLE_LINK (coff),
1017
  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
1018
1019
  NULL,
1020
1021
  COFF_SWAP_TABLE
1022
};