2002-12-31 03:25:13 +08:00
|
|
|
/* BFD library support routines for the MSP architecture.
|
2017-01-02 11:36:43 +08:00
|
|
|
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
2002-12-31 03:25:13 +08: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 22:26:43 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-12-31 03:25:13 +08: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 22:26:43 +08:00
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
2002-12-31 03:25:13 +08:00
|
|
|
|
|
|
|
#include "sysdep.h"
|
2007-04-26 22:47:00 +08:00
|
|
|
#include "bfd.h"
|
2002-12-31 03:25:13 +08:00
|
|
|
#include "libbfd.h"
|
|
|
|
|
2012-07-13 22:22:50 +08: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-31 03:25:13 +08:00
|
|
|
|
|
|
|
#define N(addr_bits, machine, print, default, next) \
|
|
|
|
{ \
|
|
|
|
16, /* 16 bits in a word. */ \
|
|
|
|
addr_bits, /* Bits in an address. */ \
|
|
|
|
8, /* 8 bits in a byte. */ \
|
|
|
|
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-02-01 01:54:39 +08:00
|
|
|
bfd_arch_default_fill, \
|
2002-12-31 03:25:13 +08:00
|
|
|
next \
|
|
|
|
}
|
|
|
|
|
|
|
|
static const bfd_arch_info_type arch_info_struct[] =
|
|
|
|
{
|
|
|
|
/* msp430x11x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp11, "MSP430", FALSE, & arch_info_struct[1]),
|
2002-12-31 03:25:13 +08:00
|
|
|
|
2003-08-08 18:14:52 +08:00
|
|
|
/* msp430x11x1. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp110, "MSP430x11x1", FALSE, & arch_info_struct[2]),
|
2003-08-08 18:14:52 +08:00
|
|
|
|
2002-12-31 03:25:13 +08:00
|
|
|
/* msp430x12x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp12, "MSP430x12", FALSE, & arch_info_struct[3]),
|
2002-12-31 03:25:13 +08:00
|
|
|
|
|
|
|
/* msp430x13x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp13, "MSP430x13", FALSE, & arch_info_struct[4]),
|
2002-12-31 03:25:13 +08:00
|
|
|
|
|
|
|
/* msp430x14x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp14, "MSP430x14", FALSE, & arch_info_struct[5]),
|
2003-08-08 18:14:52 +08:00
|
|
|
|
|
|
|
/* msp430x15x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp15, "MSP430x15", FALSE, & arch_info_struct[6]),
|
2013-01-11 04:03:55 +08:00
|
|
|
|
2003-08-08 18:14:52 +08:00
|
|
|
/* msp430x16x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp16, "MSP430x16", FALSE, & arch_info_struct[7]),
|
2002-12-31 03:25:13 +08:00
|
|
|
|
2013-05-03 05:06:15 +08:00
|
|
|
/* msp430x20x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp20, "MSP430x20", FALSE, & arch_info_struct[8]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
2005-08-09 16:57:34 +08:00
|
|
|
/* msp430x21x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp21, "MSP430x21", FALSE, & arch_info_struct[9]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
|
|
|
/* msp430x22x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp22, "MSP430x22", FALSE, & arch_info_struct[10]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
|
|
|
/* msp430x23x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp23, "MSP430x23", FALSE, & arch_info_struct[11]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
|
|
|
/* msp430x24x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp24, "MSP430x24", FALSE, & arch_info_struct[12]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
|
|
|
/* msp430x26x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp26, "MSP430x26", FALSE, & arch_info_struct[13]),
|
2005-08-09 16:57:34 +08:00
|
|
|
|
2002-12-31 03:25:13 +08:00
|
|
|
/* msp430x31x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp31, "MSP430x31", FALSE, & arch_info_struct[14]),
|
2002-12-31 03:25:13 +08:00
|
|
|
|
|
|
|
/* msp430x32x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp32, "MSP430x32", FALSE, & arch_info_struct[15]),
|
2002-12-31 03:25:13 +08:00
|
|
|
|
|
|
|
/* msp430x33x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp33, "MSP430x33", FALSE, & arch_info_struct[16]),
|
2013-01-11 04:03:55 +08:00
|
|
|
|
2002-12-31 03:25:13 +08:00
|
|
|
/* msp430x41x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp41, "MSP430x41", FALSE, & arch_info_struct[17]),
|
2003-08-08 18:14:52 +08:00
|
|
|
|
|
|
|
/* msp430x42x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp42, "MSP430x42", FALSE, & arch_info_struct[18]),
|
2002-12-31 03:25:13 +08:00
|
|
|
|
|
|
|
/* msp430x43x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp43, "MSP430x43", FALSE, & arch_info_struct[19]),
|
2002-12-31 03:25:13 +08:00
|
|
|
|
|
|
|
/* msp430x44x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp43, "MSP430x44", FALSE, & arch_info_struct[20]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
|
|
|
/* msp430x46x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp46, "MSP430x46", FALSE, & arch_info_struct[21]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
|
|
|
/* msp430x47x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp47, "MSP430x47", FALSE, & arch_info_struct[22]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
|
|
|
/* msp430x54x. */
|
2013-09-30 17:03:59 +08:00
|
|
|
N (16, bfd_mach_msp54, "MSP430x54", FALSE, & arch_info_struct[23]),
|
2013-05-03 05:06:15 +08:00
|
|
|
|
2013-09-30 17:03:59 +08:00
|
|
|
N (32, bfd_mach_msp430x, "MSP430X", FALSE, NULL)
|
2013-05-03 05:06:15 +08:00
|
|
|
|
2002-12-31 03:25:13 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
const bfd_arch_info_type bfd_msp430_arch =
|
|
|
|
N (16, bfd_mach_msp14, "msp:14", TRUE, & arch_info_struct[0]);
|
|
|
|
|