1 /* BFD library support routines for the MSP architecture.
2 Copyright (C) 2002-2024 Free Software Foundation, Inc.
3 Contributed by Dmitry Diky <diwil@mail.ru>
5 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
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. */
30 static const bfd_arch_info_type
*
31 compatible (const bfd_arch_info_type
* a
,
32 const bfd_arch_info_type
* b
)
34 /* If a & b are for different architectures we can do nothing. */
35 if (a
->arch
!= b
->arch
)
38 if (a
->mach
<= b
->mach
)
44 #define N(addr_bits, machine, print, default, next) \
46 16, /* Bits in a word. */ \
47 addr_bits, /* Bits in an address. */ \
48 8, /* Bits in a byte. */ \
50 machine, /* Machine number. */ \
51 "msp430", /* Architecture name. */ \
52 print, /* Printable name. */ \
53 1, /* Section align power. */ \
54 default, /* The default machine. */ \
57 bfd_arch_default_fill, \
59 0 /* Maximum offset of a reloc from the start of an insn. */ \
62 static const bfd_arch_info_type arch_info_struct
[] =
65 N (16, bfd_mach_msp11
, "MSP430", false, & arch_info_struct
[1]),
68 N (16, bfd_mach_msp110
, "MSP430x11x1", false, & arch_info_struct
[2]),
71 N (16, bfd_mach_msp12
, "MSP430x12", false, & arch_info_struct
[3]),
74 N (16, bfd_mach_msp13
, "MSP430x13", false, & arch_info_struct
[4]),
77 N (16, bfd_mach_msp14
, "MSP430x14", false, & arch_info_struct
[5]),
80 N (16, bfd_mach_msp15
, "MSP430x15", false, & arch_info_struct
[6]),
83 N (16, bfd_mach_msp16
, "MSP430x16", false, & arch_info_struct
[7]),
86 N (16, bfd_mach_msp20
, "MSP430x20", false, & arch_info_struct
[8]),
89 N (16, bfd_mach_msp21
, "MSP430x21", false, & arch_info_struct
[9]),
92 N (16, bfd_mach_msp22
, "MSP430x22", false, & arch_info_struct
[10]),
95 N (16, bfd_mach_msp23
, "MSP430x23", false, & arch_info_struct
[11]),
98 N (16, bfd_mach_msp24
, "MSP430x24", false, & arch_info_struct
[12]),
101 N (16, bfd_mach_msp26
, "MSP430x26", false, & arch_info_struct
[13]),
104 N (16, bfd_mach_msp31
, "MSP430x31", false, & arch_info_struct
[14]),
107 N (16, bfd_mach_msp32
, "MSP430x32", false, & arch_info_struct
[15]),
110 N (16, bfd_mach_msp33
, "MSP430x33", false, & arch_info_struct
[16]),
113 N (16, bfd_mach_msp41
, "MSP430x41", false, & arch_info_struct
[17]),
116 N (16, bfd_mach_msp42
, "MSP430x42", false, & arch_info_struct
[18]),
119 N (16, bfd_mach_msp43
, "MSP430x43", false, & arch_info_struct
[19]),
122 N (16, bfd_mach_msp43
, "MSP430x44", false, & arch_info_struct
[20]),
125 N (16, bfd_mach_msp46
, "MSP430x46", false, & arch_info_struct
[21]),
128 N (16, bfd_mach_msp47
, "MSP430x47", false, & arch_info_struct
[22]),
131 N (16, bfd_mach_msp54
, "MSP430x54", false, & arch_info_struct
[23]),
133 N (32, bfd_mach_msp430x
, "MSP430X", false, NULL
)
137 const bfd_arch_info_type bfd_msp430_arch
=
138 N (16, bfd_mach_msp14
, "msp:14", true, & arch_info_struct
[0]);