2002-12-30 20:25:13 +01:00
|
|
|
/* BFD library support routines for the MSP architecture.
|
2020-01-01 08:57:01 +01:00
|
|
|
Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
2002-12-30 20:25:13 +01:00
|
|
|
Contributed by Dmitry Diky <diwil@mail.ru>
|
|
|
|
|
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-07-03 16:26:43 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-12-30 20:25:13 +01:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2007-07-03 16:26:43 +02:00
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
2002-12-30 20:25:13 +01:00
|
|
|
|
|
|
|
#include "sysdep.h"
|
2007-04-26 16:47:00 +02:00
|
|
|
#include "bfd.h"
|
2002-12-30 20:25:13 +01:00
|
|
|
#include "libbfd.h"
|
|
|
|
|
2012-07-13 16:22:50 +02:00
|
|
|
/* This routine is provided two arch_infos and works out which MSP
|
|
|
|
machine which would be compatible with both and returns a pointer
|
|
|
|
to its info structure. */
|
|
|
|
|
|
|
|
static const bfd_arch_info_type *
|
|
|
|
compatible (const bfd_arch_info_type * a,
|
|
|
|
const bfd_arch_info_type * b)
|
|
|
|
{
|
|
|
|
/* If a & b are for different architectures we can do nothing. */
|
|
|
|
if (a->arch != b->arch)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (a->mach <= b->mach)
|
|
|
|
return b;
|
|
|
|
|
|
|
|
return a;
|
|
|
|
}
|
2002-12-30 20:25:13 +01:00
|
|
|
|
|
|
|
#define N(addr_bits, machine, print, default, next) \
|
|
|
|
{ \
|
2019-09-10 16:20:58 +02:00
|
|
|
16, /* Bits in a word. */ \
|
2002-12-30 20:25:13 +01:00
|
|
|
addr_bits, /* Bits in an address. */ \
|
2019-09-10 16:20:58 +02:00
|
|
|
8, /* Bits in a byte. */ \
|
2002-12-30 20:25:13 +01:00
|
|
|
bfd_arch_msp430, \
|
|
|
|
machine, /* Machine number. */ \
|
|
|
|
"msp430", /* Architecture name. */ \
|
|
|
|
print, /* Printable name. */ \
|
|
|
|
1, /* Section align power. */ \
|
|
|
|
default, /* The default machine. */ \
|
|
|
|
compatible, \
|
|
|
|
bfd_default_scan, \
|
2012-01-31 18:54:39 +01:00
|
|
|
bfd_arch_default_fill, \
|
2019-09-10 16:20:58 +02:00
|
|
|
next, \
|
|
|
|
0 /* Maximum offset of a reloc from the start of an insn. */ \
|
2002-12-30 20:25:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const bfd_arch_info_type arch_info_struct[] =
|
|
|
|
{
|
|
|
|
/* msp430x11x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp11, "MSP430", FALSE, & arch_info_struct[1]),
|
2002-12-30 20:25:13 +01:00
|
|
|
|
2003-08-08 12:14:52 +02:00
|
|
|
/* msp430x11x1. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp110, "MSP430x11x1", FALSE, & arch_info_struct[2]),
|
2003-08-08 12:14:52 +02:00
|
|
|
|
2002-12-30 20:25:13 +01:00
|
|
|
/* msp430x12x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp12, "MSP430x12", FALSE, & arch_info_struct[3]),
|
2002-12-30 20:25:13 +01:00
|
|
|
|
|
|
|
/* msp430x13x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp13, "MSP430x13", FALSE, & arch_info_struct[4]),
|
2002-12-30 20:25:13 +01:00
|
|
|
|
|
|
|
/* msp430x14x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp14, "MSP430x14", FALSE, & arch_info_struct[5]),
|
2003-08-08 12:14:52 +02:00
|
|
|
|
|
|
|
/* msp430x15x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp15, "MSP430x15", FALSE, & arch_info_struct[6]),
|
2013-01-10 21:03:55 +01:00
|
|
|
|
2003-08-08 12:14:52 +02:00
|
|
|
/* msp430x16x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp16, "MSP430x16", FALSE, & arch_info_struct[7]),
|
2002-12-30 20:25:13 +01:00
|
|
|
|
2013-05-02 23:06:15 +02:00
|
|
|
/* msp430x20x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp20, "MSP430x20", FALSE, & arch_info_struct[8]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
2005-08-09 10:57:34 +02:00
|
|
|
/* msp430x21x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp21, "MSP430x21", FALSE, & arch_info_struct[9]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
|
|
|
/* msp430x22x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp22, "MSP430x22", FALSE, & arch_info_struct[10]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
|
|
|
/* msp430x23x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp23, "MSP430x23", FALSE, & arch_info_struct[11]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
|
|
|
/* msp430x24x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp24, "MSP430x24", FALSE, & arch_info_struct[12]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
|
|
|
/* msp430x26x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp26, "MSP430x26", FALSE, & arch_info_struct[13]),
|
2005-08-09 10:57:34 +02:00
|
|
|
|
2002-12-30 20:25:13 +01:00
|
|
|
/* msp430x31x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp31, "MSP430x31", FALSE, & arch_info_struct[14]),
|
2002-12-30 20:25:13 +01:00
|
|
|
|
|
|
|
/* msp430x32x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp32, "MSP430x32", FALSE, & arch_info_struct[15]),
|
2002-12-30 20:25:13 +01:00
|
|
|
|
|
|
|
/* msp430x33x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp33, "MSP430x33", FALSE, & arch_info_struct[16]),
|
2013-01-10 21:03:55 +01:00
|
|
|
|
2002-12-30 20:25:13 +01:00
|
|
|
/* msp430x41x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp41, "MSP430x41", FALSE, & arch_info_struct[17]),
|
2003-08-08 12:14:52 +02:00
|
|
|
|
|
|
|
/* msp430x42x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp42, "MSP430x42", FALSE, & arch_info_struct[18]),
|
2002-12-30 20:25:13 +01:00
|
|
|
|
|
|
|
/* msp430x43x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp43, "MSP430x43", FALSE, & arch_info_struct[19]),
|
2002-12-30 20:25:13 +01:00
|
|
|
|
|
|
|
/* msp430x44x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp43, "MSP430x44", FALSE, & arch_info_struct[20]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
|
|
|
/* msp430x46x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp46, "MSP430x46", FALSE, & arch_info_struct[21]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
|
|
|
/* msp430x47x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp47, "MSP430x47", FALSE, & arch_info_struct[22]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
|
|
|
/* msp430x54x. */
|
2013-09-30 11:03:59 +02:00
|
|
|
N (16, bfd_mach_msp54, "MSP430x54", FALSE, & arch_info_struct[23]),
|
2013-05-02 23:06:15 +02:00
|
|
|
|
2013-09-30 11:03:59 +02:00
|
|
|
N (32, bfd_mach_msp430x, "MSP430X", FALSE, NULL)
|
2013-05-02 23:06:15 +02:00
|
|
|
|
2002-12-30 20:25:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const bfd_arch_info_type bfd_msp430_arch =
|
|
|
|
N (16, bfd_mach_msp14, "msp:14", TRUE, & arch_info_struct[0]);
|
|
|
|
|