Revert: [AArch64] MTE corefile support
[deliverable/binutils-gdb.git] / bfd / cpu-msp430.c
CommitLineData
2469cfa2 1/* BFD library support routines for the MSP architecture.
250d07de 2 Copyright (C) 2002-2021 Free Software Foundation, Inc.
2469cfa2
NC
3 Contributed by Dmitry Diky <diwil@mail.ru>
4
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
cd123cb7 9 the Free Software Foundation; either version 3 of the License, or
2469cfa2
NC
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
cd123cb7
NC
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
2469cfa2 21
2469cfa2 22#include "sysdep.h"
3db64b00 23#include "bfd.h"
2469cfa2
NC
24#include "libbfd.h"
25
2c3fc389
NC
26/* This routine is provided two arch_infos and works out which MSP
27 machine which would be compatible with both and returns a pointer
28 to its info structure. */
29
30static const bfd_arch_info_type *
31compatible (const bfd_arch_info_type * a,
32 const bfd_arch_info_type * b)
33{
34 /* If a & b are for different architectures we can do nothing. */
35 if (a->arch != b->arch)
36 return NULL;
37
38 if (a->mach <= b->mach)
39 return b;
40
41 return a;
42}
2469cfa2
NC
43
44#define N(addr_bits, machine, print, default, next) \
45{ \
aebcfb76 46 16, /* Bits in a word. */ \
2469cfa2 47 addr_bits, /* Bits in an address. */ \
aebcfb76 48 8, /* Bits in a byte. */ \
2469cfa2
NC
49 bfd_arch_msp430, \
50 machine, /* Machine number. */ \
51 "msp430", /* Architecture name. */ \
52 print, /* Printable name. */ \
53 1, /* Section align power. */ \
54 default, /* The default machine. */ \
55 compatible, \
56 bfd_default_scan, \
b7761f11 57 bfd_arch_default_fill, \
aebcfb76
NC
58 next, \
59 0 /* Maximum offset of a reloc from the start of an insn. */ \
2469cfa2
NC
60}
61
62static const bfd_arch_info_type arch_info_struct[] =
63{
64 /* msp430x11x. */
0a1b45a2 65 N (16, bfd_mach_msp11, "MSP430", false, & arch_info_struct[1]),
2469cfa2 66
3b260895 67 /* msp430x11x1. */
0a1b45a2 68 N (16, bfd_mach_msp110, "MSP430x11x1", false, & arch_info_struct[2]),
3b260895 69
2469cfa2 70 /* msp430x12x. */
0a1b45a2 71 N (16, bfd_mach_msp12, "MSP430x12", false, & arch_info_struct[3]),
2469cfa2
NC
72
73 /* msp430x13x. */
0a1b45a2 74 N (16, bfd_mach_msp13, "MSP430x13", false, & arch_info_struct[4]),
2469cfa2
NC
75
76 /* msp430x14x. */
0a1b45a2 77 N (16, bfd_mach_msp14, "MSP430x14", false, & arch_info_struct[5]),
3b260895
NC
78
79 /* msp430x15x. */
0a1b45a2 80 N (16, bfd_mach_msp15, "MSP430x15", false, & arch_info_struct[6]),
68ffbac6 81
3b260895 82 /* msp430x16x. */
0a1b45a2 83 N (16, bfd_mach_msp16, "MSP430x16", false, & arch_info_struct[7]),
2469cfa2 84
13761a11 85 /* msp430x20x. */
0a1b45a2 86 N (16, bfd_mach_msp20, "MSP430x20", false, & arch_info_struct[8]),
13761a11 87
3260c64d 88 /* msp430x21x. */
0a1b45a2 89 N (16, bfd_mach_msp21, "MSP430x21", false, & arch_info_struct[9]),
13761a11
NC
90
91 /* msp430x22x. */
0a1b45a2 92 N (16, bfd_mach_msp22, "MSP430x22", false, & arch_info_struct[10]),
13761a11
NC
93
94 /* msp430x23x. */
0a1b45a2 95 N (16, bfd_mach_msp23, "MSP430x23", false, & arch_info_struct[11]),
13761a11
NC
96
97 /* msp430x24x. */
0a1b45a2 98 N (16, bfd_mach_msp24, "MSP430x24", false, & arch_info_struct[12]),
13761a11
NC
99
100 /* msp430x26x. */
0a1b45a2 101 N (16, bfd_mach_msp26, "MSP430x26", false, & arch_info_struct[13]),
3260c64d 102
2469cfa2 103 /* msp430x31x. */
0a1b45a2 104 N (16, bfd_mach_msp31, "MSP430x31", false, & arch_info_struct[14]),
2469cfa2
NC
105
106 /* msp430x32x. */
0a1b45a2 107 N (16, bfd_mach_msp32, "MSP430x32", false, & arch_info_struct[15]),
2469cfa2
NC
108
109 /* msp430x33x. */
0a1b45a2 110 N (16, bfd_mach_msp33, "MSP430x33", false, & arch_info_struct[16]),
68ffbac6 111
2469cfa2 112 /* msp430x41x. */
0a1b45a2 113 N (16, bfd_mach_msp41, "MSP430x41", false, & arch_info_struct[17]),
3b260895
NC
114
115 /* msp430x42x. */
0a1b45a2 116 N (16, bfd_mach_msp42, "MSP430x42", false, & arch_info_struct[18]),
2469cfa2
NC
117
118 /* msp430x43x. */
0a1b45a2 119 N (16, bfd_mach_msp43, "MSP430x43", false, & arch_info_struct[19]),
2469cfa2
NC
120
121 /* msp430x44x. */
0a1b45a2 122 N (16, bfd_mach_msp43, "MSP430x44", false, & arch_info_struct[20]),
13761a11
NC
123
124 /* msp430x46x. */
0a1b45a2 125 N (16, bfd_mach_msp46, "MSP430x46", false, & arch_info_struct[21]),
13761a11
NC
126
127 /* msp430x47x. */
0a1b45a2 128 N (16, bfd_mach_msp47, "MSP430x47", false, & arch_info_struct[22]),
13761a11
NC
129
130 /* msp430x54x. */
0a1b45a2 131 N (16, bfd_mach_msp54, "MSP430x54", false, & arch_info_struct[23]),
13761a11 132
0a1b45a2 133 N (32, bfd_mach_msp430x, "MSP430X", false, NULL)
13761a11 134
2469cfa2
NC
135};
136
137const bfd_arch_info_type bfd_msp430_arch =
0a1b45a2 138 N (16, bfd_mach_msp14, "msp:14", true, & arch_info_struct[0]);
2469cfa2 139
This page took 0.858776 seconds and 4 git commands to generate.