mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-03 04:12:10 +08:00
13761a1136
* config.bfd (msp430): Define targ_selvecs. * configure.in: Add bfd_elf32_msp430_ti_vec. * cpu-msp430.c: Add some more MSP430 machine numbers. * elf32-msp430.c Add support for MSP430X relocations. Add support for TI compiler generated relocations. Add support for sym_diff relocations. Add support for relaxing out of range short branches into long branches. Add support for MSP430 attribute section. * reloc.c: Add MSP430X relocations. * targets.c: Add bfd_elf32_msp430_ti_vec. * bfd-in2.h: Regenerate. * configure: Regenerate. * libbfd.h: Regenerate. * readelf.c: Add support for MSP430X architecture. * readelf.exp: Expect -wi test to fail for the MSP430. * config/tc-msp430.c: Add support for the MSP430X architecture. Add code to insert a NOP instruction after any instruction that might change the interrupt state. Add support for the LARGE memory model. Add code to initialise the .MSP430.attributes section. * config/tc-msp430.h: Add support for the MSP430X architecture. * doc/c-msp430.texi: Document the new -mL and -mN command line options. * NEWS: Mention support for the MSP430X architecture. * gas/all/gas.exp: Skip the DIFF1 test for the MSP430. Expect the FORWARD test to pass for the MSP430. Skip the REDEF tests for the MSP430. Expect the 930509A test to fail for the MSP430. * gas/all/sleb128-4.d: Skip for the MSP430. * gas/elf/elf.exp: Set target_machine to msp430 for the MSP430. Skip the EHOPT0 test for the MSP430. Skip the REDEF and EQU-RELOC tests for the MSP430. * gas/elf/section2.e-msp430: New file. * gas/lns/lns-big-delta.d: Remove expectation of 20-bit addresses. * gas/lns/lns.exp: Use alternate LNS COMMON test for the MSP430. * gas/msp430/msp430x.s: New test. * gas/msp430/msp430x.d: Expected disassembly. * gas/msp430/msp430.exp: Run new test. * gas/msp430/opcode.d: Update expected disassembly. * msp430.h: Add MSP430X relocs. Add some more MSP430 machine numbers. Add values used by .MSP430.attributes section. * msp430.h: Add patterns for MSP430X instructions. * Makefile.am: Add emsp430X.c * Makefine.in: Regenerate. * configure.tgt (msp430): Add msp430X emulation. * ldmain.c (multiple_definition): Only disable relaxation if it was enabled by the user. * ldmain.h (RELAXATION_ENABLED_BY_USER): New macro. * emulparams/msp430all.sh: Add support for MSP430X. * emultempl/generic.em: (before_parse): Enable relaxation for the MSP430. * scripttempl/msp430.sc: Reorganize sections. Add .rodata section. * scripttempl/msp430_3.sc: Likewise. * NEWS: Mention support for MSP430X. * ld-elf/flags1.d: Expect this test to pass on the MSP430. * ld-elf/init-fini-arrays.d: Expect this test to fail on the MSP430. * ld-elf/merge.d: Expect this test to pass on the MSP430. * ld-elf/sec64k.exp: Skip these tests for the MSP430. * ld-gc/pr13683.d: Expect this test to fail on the MSP430. * ld-srec/srec.exp: Expect these tests to fail on the MSP430. * ld-undefined/undefined.exp: Expect the UNDEFINED LINE test to fail on the MSP430. * msp430-dis.c: Add support for MSP430X instructions.
139 lines
4.1 KiB
C
139 lines
4.1 KiB
C
/* BFD library support routines for the MSP architecture.
|
|
Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
|
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
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(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
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
MA 02110-1301, USA. */
|
|
|
|
#include "sysdep.h"
|
|
#include "bfd.h"
|
|
#include "libbfd.h"
|
|
|
|
/* 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;
|
|
}
|
|
|
|
#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, \
|
|
bfd_arch_default_fill, \
|
|
next \
|
|
}
|
|
|
|
static const bfd_arch_info_type arch_info_struct[] =
|
|
{
|
|
/* msp430x11x. */
|
|
N (16, bfd_mach_msp11, "msp:11", FALSE, & arch_info_struct[1]),
|
|
|
|
/* msp430x11x1. */
|
|
N (16, bfd_mach_msp110, "msp:110", FALSE, & arch_info_struct[2]),
|
|
|
|
/* msp430x12x. */
|
|
N (16, bfd_mach_msp12, "msp:12", FALSE, & arch_info_struct[3]),
|
|
|
|
/* msp430x13x. */
|
|
N (16, bfd_mach_msp13, "msp:13", FALSE, & arch_info_struct[4]),
|
|
|
|
/* msp430x14x. */
|
|
N (16, bfd_mach_msp14, "msp:14", FALSE, & arch_info_struct[5]),
|
|
|
|
/* msp430x15x. */
|
|
N (16, bfd_mach_msp15, "msp:15", FALSE, & arch_info_struct[6]),
|
|
|
|
/* msp430x16x. */
|
|
N (16, bfd_mach_msp16, "msp:16", FALSE, & arch_info_struct[7]),
|
|
|
|
/* msp430x20x. */
|
|
N (16, bfd_mach_msp20, "msp:20", FALSE, & arch_info_struct[8]),
|
|
|
|
/* msp430x21x. */
|
|
N (16, bfd_mach_msp21, "msp:21", FALSE, & arch_info_struct[9]),
|
|
|
|
/* msp430x22x. */
|
|
N (16, bfd_mach_msp22, "msp:22", FALSE, & arch_info_struct[10]),
|
|
|
|
/* msp430x23x. */
|
|
N (16, bfd_mach_msp23, "msp:23", FALSE, & arch_info_struct[11]),
|
|
|
|
/* msp430x24x. */
|
|
N (16, bfd_mach_msp24, "msp:24", FALSE, & arch_info_struct[12]),
|
|
|
|
/* msp430x26x. */
|
|
N (16, bfd_mach_msp26, "msp:26", FALSE, & arch_info_struct[13]),
|
|
|
|
/* msp430x31x. */
|
|
N (16, bfd_mach_msp31, "msp:31", FALSE, & arch_info_struct[14]),
|
|
|
|
/* msp430x32x. */
|
|
N (16, bfd_mach_msp32, "msp:32", FALSE, & arch_info_struct[15]),
|
|
|
|
/* msp430x33x. */
|
|
N (16, bfd_mach_msp33, "msp:33", FALSE, & arch_info_struct[16]),
|
|
|
|
/* msp430x41x. */
|
|
N (16, bfd_mach_msp41, "msp:41", FALSE, & arch_info_struct[17]),
|
|
|
|
/* msp430x42x. */
|
|
N (16, bfd_mach_msp42, "msp:42", FALSE, & arch_info_struct[18]),
|
|
|
|
/* msp430x43x. */
|
|
N (16, bfd_mach_msp43, "msp:43", FALSE, & arch_info_struct[19]),
|
|
|
|
/* msp430x44x. */
|
|
N (16, bfd_mach_msp43, "msp:44", FALSE, & arch_info_struct[20]),
|
|
|
|
/* msp430x46x. */
|
|
N (16, bfd_mach_msp46, "msp:46", FALSE, & arch_info_struct[21]),
|
|
|
|
/* msp430x47x. */
|
|
N (16, bfd_mach_msp47, "msp:47", FALSE, & arch_info_struct[22]),
|
|
|
|
/* msp430x54x. */
|
|
N (16, bfd_mach_msp54, "msp:54", FALSE, & arch_info_struct[23]),
|
|
|
|
N (32, bfd_mach_msp430x, "msp:430X", FALSE, NULL)
|
|
|
|
};
|
|
|
|
const bfd_arch_info_type bfd_msp430_arch =
|
|
N (16, bfd_mach_msp14, "msp:14", TRUE, & arch_info_struct[0]);
|
|
|