gdb: resume ongoing step after handling fork or vfork
[deliverable/binutils-gdb.git] / bfd / elf32-mt.c
CommitLineData
d031aafb 1/* Morpho Technologies MT specific support for 32-bit ELF
250d07de 2 Copyright (C) 2001-2021 Free Software Foundation, Inc.
de33e640
AH
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
cd123cb7 8 the Free Software Foundation; either version 3 of the License, or
de33e640
AH
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
863f7a5f
NC
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
de33e640 20
de33e640 21#include "sysdep.h"
3db64b00 22#include "bfd.h"
de33e640
AH
23#include "libbfd.h"
24#include "elf-bfd.h"
4970f871 25#include "elf/mt.h"
de33e640
AH
26
27/* Prototypes. */
68ffbac6 28static reloc_howto_type * mt_reloc_type_lookup
de33e640
AH
29 (bfd *, bfd_reloc_code_real_type);
30
0a1b45a2 31static bool mt_info_to_howto_rela
de33e640
AH
32 (bfd *, arelent *, Elf_Internal_Rela *);
33
d031aafb 34static bfd_reloc_status_type mt_elf_relocate_hi16
de33e640
AH
35 (bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma);
36
d031aafb 37static bfd_reloc_status_type mt_final_link_relocate
68ffbac6 38 (reloc_howto_type *, bfd *, asection *, bfd_byte *,
de33e640
AH
39 Elf_Internal_Rela *, bfd_vma);
40
0f684201 41static int mt_elf_relocate_section
68ffbac6 42 (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
de33e640
AH
43 Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
44
45/* Relocation tables. */
d031aafb 46static reloc_howto_type mt_elf_howto_table [] =
de33e640
AH
47{
48 /* This reloc does nothing. */
07d6d2b8
AM
49 HOWTO (R_MT_NONE, /* type */
50 0, /* rightshift */
51 3, /* size (0 = byte, 1 = short, 2 = long) */
52 0, /* bitsize */
0a1b45a2 53 false, /* pc_relative */
07d6d2b8
AM
54 0, /* bitpos */
55 complain_overflow_dont, /* complain_on_overflow */
56 bfd_elf_generic_reloc, /* special_function */
57 "R_MT_NONE", /* name */
0a1b45a2 58 false, /* partial_inplace */
07d6d2b8
AM
59 0 , /* src_mask */
60 0, /* dst_mask */
0a1b45a2 61 false), /* pcrel_offset */
de33e640
AH
62
63 /* A 16 bit absolute relocation. */
07d6d2b8
AM
64 HOWTO (R_MT_16, /* type */
65 0, /* rightshift */
66 2, /* size (0 = byte, 1 = short, 2 = long) */
67 16, /* bitsize */
0a1b45a2 68 false, /* pc_relative */
07d6d2b8
AM
69 0, /* bitpos */
70 complain_overflow_dont, /* complain_on_overflow */
71 bfd_elf_generic_reloc, /* special_function */
72 "R_MT_16", /* name */
0a1b45a2 73 false, /* partial_inplace */
07d6d2b8
AM
74 0 , /* src_mask */
75 0xffff, /* dst_mask */
0a1b45a2 76 false), /* pcrel_offset */
de33e640
AH
77
78 /* A 32 bit absolute relocation. */
07d6d2b8
AM
79 HOWTO (R_MT_32, /* type */
80 0, /* rightshift */
81 2, /* size (0 = byte, 1 = short, 2 = long) */
82 32, /* bitsize */
0a1b45a2 83 false, /* pc_relative */
07d6d2b8
AM
84 0, /* bitpos */
85 complain_overflow_dont, /* complain_on_overflow */
86 bfd_elf_generic_reloc, /* special_function */
87 "R_MT_32", /* name */
0a1b45a2 88 false, /* partial_inplace */
07d6d2b8
AM
89 0 , /* src_mask */
90 0xffffffff, /* dst_mask */
0a1b45a2 91 false), /* pcrel_offset */
de33e640
AH
92
93 /* A 32 bit pc-relative relocation. */
07d6d2b8
AM
94 HOWTO (R_MT_32_PCREL, /* type */
95 0, /* rightshift */
96 2, /* size (0 = byte, 1 = short, 2 = long) */
97 32, /* bitsize */
0a1b45a2 98 true, /* pc_relative */
07d6d2b8
AM
99 0, /* bitpos */
100 complain_overflow_dont, /* complain_on_overflow */
101 bfd_elf_generic_reloc, /* special_function */
102 "R_MT_32_PCREL", /* name */
0a1b45a2 103 false, /* partial_inplace */
07d6d2b8
AM
104 0 , /* src_mask */
105 0xffffffff, /* dst_mask */
0a1b45a2 106 true), /* pcrel_offset */
de33e640
AH
107
108 /* A 16 bit pc-relative relocation. */
07d6d2b8
AM
109 HOWTO (R_MT_PC16, /* type */
110 0, /* rightshift */
111 2, /* size (0 = byte, 1 = short, 2 = long) */
112 16, /* bitsize */
0a1b45a2 113 true, /* pc_relative */
07d6d2b8
AM
114 0, /* bitpos */
115 complain_overflow_signed, /* complain_on_overflow */
116 bfd_elf_generic_reloc, /* special_function */
117 "R_MT_PC16", /* name */
0a1b45a2 118 false, /* partial_inplace */
07d6d2b8
AM
119 0, /* src_mask */
120 0xffff, /* dst_mask */
0a1b45a2 121 true), /* pcrel_offset */
de33e640
AH
122
123 /* high 16 bits of symbol value. */
07d6d2b8
AM
124 HOWTO (R_MT_HI16, /* type */
125 0, /* rightshift */
126 2, /* size (0 = byte, 1 = short, 2 = long) */
127 16, /* bitsize */
0a1b45a2 128 false, /* pc_relative */
07d6d2b8
AM
129 0, /* bitpos */
130 complain_overflow_dont, /* complain_on_overflow */
131 bfd_elf_generic_reloc, /* special_function */
132 "R_MT_HI16", /* name */
0a1b45a2 133 false, /* partial_inplace */
07d6d2b8
AM
134 0xffff0000, /* src_mask */
135 0xffff0000, /* dst_mask */
0a1b45a2 136 false), /* pcrel_offset */
de33e640
AH
137
138 /* Low 16 bits of symbol value. */
07d6d2b8
AM
139 HOWTO (R_MT_LO16, /* type */
140 0, /* rightshift */
141 2, /* size (0 = byte, 1 = short, 2 = long) */
142 16, /* bitsize */
0a1b45a2 143 false, /* pc_relative */
07d6d2b8
AM
144 0, /* bitpos */
145 complain_overflow_dont, /* complain_on_overflow */
146 bfd_elf_generic_reloc, /* special_function */
147 "R_MT_LO16", /* name */
0a1b45a2 148 false, /* partial_inplace */
07d6d2b8
AM
149 0xffff, /* src_mask */
150 0xffff, /* dst_mask */
0a1b45a2 151 false), /* pcrel_offset */
de33e640
AH
152};
153
d031aafb 154/* Map BFD reloc types to MT ELF reloc types. */
de33e640
AH
155
156static reloc_howto_type *
d031aafb 157mt_reloc_type_lookup
07d6d2b8 158 (bfd * abfd ATTRIBUTE_UNUSED,
de33e640
AH
159 bfd_reloc_code_real_type code)
160{
d031aafb 161 /* Note that the mt_elf_howto_table is indxed by the R_
de33e640
AH
162 constants. Thus, the order that the howto records appear in the
163 table *must* match the order of the relocation types defined in
d031aafb 164 include/elf/mt.h. */
de33e640
AH
165
166 switch (code)
167 {
168 case BFD_RELOC_NONE:
d031aafb 169 return &mt_elf_howto_table[ (int) R_MT_NONE];
de33e640 170 case BFD_RELOC_16:
d031aafb 171 return &mt_elf_howto_table[ (int) R_MT_16];
de33e640 172 case BFD_RELOC_32:
d031aafb 173 return &mt_elf_howto_table[ (int) R_MT_32];
de33e640 174 case BFD_RELOC_32_PCREL:
d031aafb 175 return &mt_elf_howto_table[ (int) R_MT_32_PCREL];
de33e640 176 case BFD_RELOC_16_PCREL:
d031aafb 177 return &mt_elf_howto_table[ (int) R_MT_PC16];
de33e640 178 case BFD_RELOC_HI16:
d031aafb 179 return &mt_elf_howto_table[ (int) R_MT_HI16];
de33e640 180 case BFD_RELOC_LO16:
d031aafb 181 return &mt_elf_howto_table[ (int) R_MT_LO16];
de33e640
AH
182
183 default:
184 /* Pacify gcc -Wall. */
185 return NULL;
186 }
187 return NULL;
188}
189
157090f7
AM
190static reloc_howto_type *
191mt_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
192 const char *r_name)
193{
194 unsigned int i;
195
196 for (i = 0;
197 i < sizeof (mt_elf_howto_table) / sizeof (mt_elf_howto_table[0]);
198 i++)
199 if (mt_elf_howto_table[i].name != NULL
200 && strcasecmp (mt_elf_howto_table[i].name, r_name) == 0)
201 return &mt_elf_howto_table[i];
202
203 return NULL;
204}
205
de33e640 206bfd_reloc_status_type
d031aafb 207mt_elf_relocate_hi16
07d6d2b8 208 (bfd * input_bfd,
de33e640 209 Elf_Internal_Rela * relhi,
07d6d2b8
AM
210 bfd_byte * contents,
211 bfd_vma value)
de33e640
AH
212{
213 bfd_vma insn;
214
215 insn = bfd_get_32 (input_bfd, contents + relhi->r_offset);
216
217 value += relhi->r_addend;
218 value >>= 16;
219 insn = ((insn & ~0xFFFF) | value);
220
221 bfd_put_32 (input_bfd, insn, contents + relhi->r_offset);
222 return bfd_reloc_ok;
223}
224\f
225/* XXX: The following code is the result of a cut&paste. This unfortunate
226 practice is very widespread in the various target back-end files. */
227
d031aafb 228/* Set the howto pointer for a MT ELF reloc. */
de33e640 229
0a1b45a2
AM
230static bool
231mt_info_to_howto_rela (bfd *abfd,
232 arelent *cache_ptr,
233 Elf_Internal_Rela *dst)
de33e640
AH
234{
235 unsigned int r_type;
236
237 r_type = ELF32_R_TYPE (dst->r_info);
5860e3f8
NC
238 if (r_type >= (unsigned int) R_MT_max)
239 {
695344c0 240 /* xgettext:c-format */
0aa13fee
AM
241 _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
242 abfd, r_type);
f3185997 243 bfd_set_error (bfd_error_bad_value);
0a1b45a2 244 return false;
5860e3f8 245 }
d031aafb 246 cache_ptr->howto = & mt_elf_howto_table [r_type];
0a1b45a2 247 return true;
de33e640
AH
248}
249
250/* Perform a single relocation. By default we use the standard BFD
251 routines. */
252
253static bfd_reloc_status_type
d031aafb 254mt_final_link_relocate
07d6d2b8
AM
255 (reloc_howto_type * howto,
256 bfd * input_bfd,
257 asection * input_section,
258 bfd_byte * contents,
de33e640 259 Elf_Internal_Rela * rel,
07d6d2b8 260 bfd_vma relocation)
de33e640
AH
261{
262 return _bfd_final_link_relocate (howto, input_bfd, input_section,
263 contents, rel->r_offset,
264 relocation, rel->r_addend);
265}
266
d031aafb 267/* Relocate a MT ELF section.
de33e640
AH
268 There is some attempt to make this function usable for many architectures,
269 both USE_REL and USE_RELA ['twould be nice if such a critter existed],
270 if only to serve as a learning tool.
271
272 The RELOCATE_SECTION function is called by the new ELF backend linker
273 to handle the relocations for a section.
274
275 The relocs are always passed as Rela structures; if the section
276 actually uses Rel structures, the r_addend field will always be
277 zero.
278
279 This function is responsible for adjusting the section contents as
280 necessary, and (if using Rela relocs and generating a relocatable
281 output file) adjusting the reloc addend as necessary.
282
283 This function does not have to worry about setting the reloc
284 address or the reloc symbol index.
285
286 LOCAL_SYMS is a pointer to the swapped in local symbols.
287
288 LOCAL_SECTIONS is an array giving the section in the input file
289 corresponding to the st_shndx field of each local symbol.
290
291 The global hash table entry for the global symbols can be found
292 via elf_sym_hashes (input_bfd).
293
294 When generating relocatable output, this function must handle
295 STB_LOCAL/STT_SECTION symbols specially. The output symbol is
296 going to be the section symbol corresponding to the output
297 section, which means that the addend must be adjusted
298 accordingly. */
299
0f684201 300static int
d031aafb 301mt_elf_relocate_section
07d6d2b8 302 (bfd * output_bfd ATTRIBUTE_UNUSED,
de33e640 303 struct bfd_link_info * info,
07d6d2b8
AM
304 bfd * input_bfd,
305 asection * input_section,
306 bfd_byte * contents,
de33e640 307 Elf_Internal_Rela * relocs,
07d6d2b8
AM
308 Elf_Internal_Sym * local_syms,
309 asection ** local_sections)
de33e640 310{
07d6d2b8 311 Elf_Internal_Shdr * symtab_hdr;
de33e640 312 struct elf_link_hash_entry ** sym_hashes;
07d6d2b8
AM
313 Elf_Internal_Rela * rel;
314 Elf_Internal_Rela * relend;
de33e640
AH
315
316 symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
317 sym_hashes = elf_sym_hashes (input_bfd);
318 relend = relocs + input_section->reloc_count;
319
320 for (rel = relocs; rel < relend; rel ++)
321 {
07d6d2b8
AM
322 reloc_howto_type * howto;
323 unsigned long r_symndx;
324 Elf_Internal_Sym * sym;
325 asection * sec;
de33e640 326 struct elf_link_hash_entry * h;
07d6d2b8
AM
327 bfd_vma relocation;
328 bfd_reloc_status_type r;
329 const char * name = NULL;
330 int r_type;
68ffbac6 331
de33e640
AH
332 r_type = ELF32_R_TYPE (rel->r_info);
333
334 r_symndx = ELF32_R_SYM (rel->r_info);
335
d031aafb 336 howto = mt_elf_howto_table + ELF32_R_TYPE (rel->r_info);
de33e640
AH
337 h = NULL;
338 sym = NULL;
339 sec = NULL;
68ffbac6 340
de33e640
AH
341 if (r_symndx < symtab_hdr->sh_info)
342 {
343 sym = local_syms + r_symndx;
344 sec = local_sections [r_symndx];
345 relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
68ffbac6 346
de33e640
AH
347 name = bfd_elf_string_from_elf_section
348 (input_bfd, symtab_hdr->sh_link, sym->st_name);
fd361982 349 name = name == NULL ? bfd_section_name (sec) : name;
de33e640
AH
350 }
351 else
352 {
0a1b45a2
AM
353 bool unresolved_reloc;
354 bool warned, ignored;
de33e640
AH
355
356 RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
357 r_symndx, symtab_hdr, sym_hashes,
358 h, sec, relocation,
62d887d4 359 unresolved_reloc, warned, ignored);
de33e640
AH
360
361 name = h->root.root.string;
362 }
363
dbaa2011 364 if (sec != NULL && discarded_section (sec))
e4067dbb 365 RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
545fd46b 366 rel, 1, relend, howto, 0, contents);
ab96bf03 367
0e1862bb 368 if (bfd_link_relocatable (info))
ab96bf03 369 continue;
de33e640 370
d031aafb 371 /* Finally, the sole MT-specific part. */
de33e640 372 switch (r_type)
07d6d2b8
AM
373 {
374 case R_MT_HI16:
375 r = mt_elf_relocate_hi16 (input_bfd, rel, contents, relocation);
376 break;
de33e640 377 default:
07d6d2b8
AM
378 r = mt_final_link_relocate (howto, input_bfd, input_section,
379 contents, rel, relocation);
380 break;
381 }
de33e640
AH
382
383
384 if (r != bfd_reloc_ok)
385 {
386 const char * msg = (const char *) NULL;
387
388 switch (r)
389 {
390 case bfd_reloc_overflow:
1a72702b 391 (*info->callbacks->reloc_overflow)
de33e640
AH
392 (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0,
393 input_bfd, input_section, rel->r_offset);
394 break;
68ffbac6 395
de33e640 396 case bfd_reloc_undefined:
1a72702b 397 (*info->callbacks->undefined_symbol)
0a1b45a2 398 (info, name, input_bfd, input_section, rel->r_offset, true);
de33e640 399 break;
68ffbac6 400
de33e640
AH
401 case bfd_reloc_outofrange:
402 msg = _("internal error: out of range error");
403 break;
404
405 case bfd_reloc_dangerous:
406 msg = _("internal error: dangerous relocation");
407 break;
408
409 default:
410 msg = _("internal error: unknown error");
411 break;
412 }
413
414 if (msg)
1a72702b
AM
415 (*info->callbacks->warning) (info, msg, name, input_bfd,
416 input_section, rel->r_offset);
de33e640
AH
417 }
418 }
419
0a1b45a2 420 return true;
de33e640
AH
421}
422
de33e640
AH
423/* Look through the relocs for a section during the first phase.
424 Since we don't do .gots or .plts, we just need to consider the
425 virtual table relocs for gc. */
68ffbac6 426
0a1b45a2
AM
427static bool
428mt_elf_check_relocs (bfd *abfd,
429 struct bfd_link_info *info,
430 asection *sec,
431 const Elf_Internal_Rela *relocs)
de33e640 432{
0a1b45a2
AM
433 Elf_Internal_Shdr *symtab_hdr;
434 struct elf_link_hash_entry **sym_hashes;
435 const Elf_Internal_Rela *rel;
436 const Elf_Internal_Rela *rel_end;
68ffbac6 437
0e1862bb 438 if (bfd_link_relocatable (info))
0a1b45a2 439 return true;
68ffbac6 440
de33e640
AH
441 symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
442 sym_hashes = elf_sym_hashes (abfd);
68ffbac6 443
de33e640
AH
444 rel_end = relocs + sec->reloc_count;
445 for (rel = relocs; rel < rel_end; rel++)
446 {
447 struct elf_link_hash_entry *h;
448 unsigned long r_symndx;
68ffbac6 449
de33e640
AH
450 r_symndx = ELF32_R_SYM (rel->r_info);
451 if (r_symndx < symtab_hdr->sh_info)
07d6d2b8 452 h = NULL;
de33e640 453 else
973a3492
L
454 {
455 h = sym_hashes[r_symndx - symtab_hdr->sh_info];
456 while (h->root.type == bfd_link_hash_indirect
457 || h->root.type == bfd_link_hash_warning)
458 h = (struct elf_link_hash_entry *) h->root.u.i.link;
459 }
de33e640
AH
460 }
461
0a1b45a2 462 return true;
de33e640
AH
463}
464
465/* Return the MACH for an e_flags value. */
466
467static int
d031aafb 468elf32_mt_machine (bfd *abfd)
de33e640 469{
d031aafb 470 switch (elf_elfheader (abfd)->e_flags & EF_MT_CPU_MASK)
de33e640 471 {
d031aafb
NS
472 case EF_MT_CPU_MRISC: return bfd_mach_ms1;
473 case EF_MT_CPU_MRISC2: return bfd_mach_mrisc2;
474 case EF_MT_CPU_MS2: return bfd_mach_ms2;
de33e640
AH
475 }
476
477 return bfd_mach_ms1;
478}
479
0a1b45a2
AM
480static bool
481mt_elf_object_p (bfd *abfd)
de33e640 482{
d031aafb 483 bfd_default_set_arch_mach (abfd, bfd_arch_mt, elf32_mt_machine (abfd));
de33e640 484
0a1b45a2 485 return true;
de33e640
AH
486}
487
488/* Function to set the ELF flag bits. */
489
0a1b45a2
AM
490static bool
491mt_elf_set_private_flags (bfd *abfd, flagword flags)
de33e640
AH
492{
493 elf_elfheader (abfd)->e_flags = flags;
0a1b45a2
AM
494 elf_flags_init (abfd) = true;
495 return true;
de33e640
AH
496}
497
de33e640
AH
498/* Merge backend specific data from an object file to the output
499 object file when linking. */
500
0a1b45a2 501static bool
50e03d47 502mt_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
de33e640 503{
50e03d47 504 bfd *obfd = info->output_bfd;
0a1b45a2
AM
505 flagword old_flags, new_flags;
506 bool ok = true;
de33e640 507
cc643b88 508 /* Check if we have the same endianness. */
50e03d47 509 if (!_bfd_generic_verify_endian_match (ibfd, info))
0a1b45a2 510 return false;
de33e640 511
d031aafb 512 /* If they're not both mt, then merging is meaningless, so just
de33e640 513 don't do it. */
d031aafb 514 if (strcmp (ibfd->arch_info->arch_name, "mt") != 0)
0a1b45a2 515 return true;
d031aafb 516 if (strcmp (obfd->arch_info->arch_name, "mt") != 0)
0a1b45a2 517 return true;
de33e640
AH
518
519 new_flags = elf_elfheader (ibfd)->e_flags;
520 old_flags = elf_elfheader (obfd)->e_flags;
521
522#ifdef DEBUG
871b3ab2 523 _bfd_error_handler ("%pB: old_flags = 0x%.8x, new_flags = 0x%.8x, init = %s",
de33e640
AH
524 ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no");
525#endif
526
6f84a2a6
NS
527 if (!elf_flags_init (obfd))
528 {
529 old_flags = new_flags;
0a1b45a2 530 elf_flags_init (obfd) = true;
6f84a2a6 531 }
d031aafb 532 else if ((new_flags & EF_MT_CPU_MASK) != (old_flags & EF_MT_CPU_MASK))
6f84a2a6
NS
533 {
534 /* CPU has changed. This is invalid, because MRISC, MRISC2 and
535 MS2 are not subsets of each other. */
0a1b45a2 536 ok = false;
6f84a2a6 537 }
68ffbac6 538
e510ff97 539 if (ok)
de33e640 540 {
de33e640 541 obfd->arch_info = ibfd->arch_info;
6f84a2a6 542 elf_elfheader (obfd)->e_flags = old_flags;
de33e640
AH
543 }
544
e510ff97 545 return ok;
de33e640
AH
546}
547
0a1b45a2
AM
548static bool
549mt_elf_print_private_bfd_data (bfd *abfd, void *ptr)
de33e640 550{
0a1b45a2 551 FILE *file = (FILE *) ptr;
de33e640
AH
552 flagword flags;
553
554 BFD_ASSERT (abfd != NULL && ptr != NULL);
68ffbac6 555
de33e640
AH
556 /* Print normal ELF private data. */
557 _bfd_elf_print_private_bfd_data (abfd, ptr);
558
559 flags = elf_elfheader (abfd)->e_flags;
0af1713e 560 fprintf (file, _("private flags = 0x%lx:"), (unsigned long) flags);
de33e640 561
d031aafb 562 switch (flags & EF_MT_CPU_MASK)
de33e640
AH
563 {
564 default:
d031aafb
NS
565 case EF_MT_CPU_MRISC: fprintf (file, " ms1-16-002"); break;
566 case EF_MT_CPU_MRISC2: fprintf (file, " ms1-16-003"); break;
567 case EF_MT_CPU_MS2: fprintf (file, " ms2"); break;
de33e640
AH
568 }
569
570 fputc ('\n', file);
571
0a1b45a2 572 return true;
de33e640
AH
573}
574
575\f
6d00b590 576#define TARGET_BIG_SYM mt_elf32_vec
07d6d2b8 577#define TARGET_BIG_NAME "elf32-mt"
de33e640 578
d031aafb
NS
579#define ELF_ARCH bfd_arch_mt
580#define ELF_MACHINE_CODE EM_MT
07d6d2b8 581#define ELF_MAXPAGESIZE 1 /* No pages on the MT. */
de33e640
AH
582
583#define elf_info_to_howto_rel NULL
d031aafb 584#define elf_info_to_howto mt_info_to_howto_rela
de33e640 585
d031aafb 586#define elf_backend_relocate_section mt_elf_relocate_section
de33e640 587
07d6d2b8
AM
588#define bfd_elf32_bfd_reloc_type_lookup mt_reloc_type_lookup
589#define bfd_elf32_bfd_reloc_name_lookup mt_reloc_name_lookup
de33e640 590
07d6d2b8
AM
591#define elf_backend_check_relocs mt_elf_check_relocs
592#define elf_backend_object_p mt_elf_object_p
de33e640
AH
593#define elf_backend_rela_normal 1
594
595#define elf_backend_can_gc_sections 1
596
d031aafb 597#define bfd_elf32_bfd_set_private_flags mt_elf_set_private_flags
d031aafb
NS
598#define bfd_elf32_bfd_merge_private_bfd_data mt_elf_merge_private_bfd_data
599#define bfd_elf32_bfd_print_private_bfd_data mt_elf_print_private_bfd_data
de33e640
AH
600
601#include "elf32-target.h"
This page took 0.86034 seconds and 4 git commands to generate.