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