Chris Liechti wrote:
3)constructors/destructors jf staitc not called from startup code (as in previous version, needs libmspgcc.S fixes).

ok.. some knowledgeable person ready to submit patches?
I spend some time to fix this and some other problems. All patches
attached.

I rewrite startup code in libmspgcc.S to split it into .init0...init9
sections, added constructors/destructors calling code to .init6/.fini6
sections and fixed constructors/destructors generation code in compiler
(gcc-3.2.3-initX_ctors_dtors.patch).
Now user can redefine the whole startup code by adding _reset_vector__
function as in previous version, but also can replace parts of startup code:

  - adding __low_level_init() function to section .init3 causes
replacing only watchdog disabling code:
extern "C" __attribute__((__naked__, __section__(".init3"))) void
__low_level_init()
{
     WDTCTL = WDTPW | WDTHOLD;
     P1DIR = (1<<7)|(0<<6)|(1<<5)|(1<<4)|(1<<3)|(1<<2)|(1<<1)|(1<<0);
     P1OUT = (1<<6);
     P1REN = (1<<6);
...............
}
  - adding __do_copy_data function to .init4 section replaces only .data
section initialisation
  - adding __do_clear_bss function to .init4 section replaces only .bss
section zeroing
  - adding __jump_to_main function to .init9 section replaces only br
#main command
  - adding __stop_progExec__ function replaces endless loop after return
from main().
If there is no .data or/and .bss variables, __do_copy_data or/and
__do_clear_bss will not be linked, saving code space. Also check that
.data/.bss size == 0 not needed anymore.
Sections .init1, .init5, .init7, .init8 are empty and user can add it's
own code to it.
This startup code uses 1 register instead of 3 now and 22 bytes shorter.

I also found, that mspgcc places not explicitly initialized variables to
.data section instead .bss, adding zeros .data initialization area. This
issue fixed in gcc-3.2.3-bss.patch

6)--ffunction-sections with --gc-sections causes all code to be removed from output file. Needs corrections of linker scripts: also, KEEP() must be added to all .initX, .finiX, .ctors and .dtors sections.

ok, looks like an easy thing, there are just so many files... ;-)
No, just two scripts templates (see binutils-ld_scripts.patch).

I think I can make a patch to fix linker scripts if required.

that would be great. while i think i understand your changes, i'm not having much practice working with these files.
  I added all necessary KEEP()s and some symbols (__data_size,
__data_load_start etc) required by my startup code. --ffunction-sections
and --gc-sections works now.
Other scripts changes:
  - *(.bss.*), *(.data.*) and *(.noinit.*) sections added for future
support of --fdata-sections.
  - tabs replaced with spaces.
  - : AT ( ADDR(section) +  SIZEOF(section) ) replaced with AT > region
to simplify script extending by user and script itself.

I can't found, why empty lines from template are discarded during
scrtipt generation. Can anyone fix it? It will make scripts more readable.


And last, i applied binutils-2.17 patches from cvs /packagaging/patches
to binutils-2.18. Renewed patches are
binutils-2.18-14x1-20x1-20x2-20x3-22x4-42x-42x0-461x.patch and
binutils-2.18-msp430x24x-msp430x26x.patch. My binutils-ld_scripts.patch
can be applied after them to binutils 2.18 too. Is there any reason to
stay on 2.17 version of binutils instead of 2.18?

   Sergey

diff -ur binutils-2.18.orig/bfd/archures.c binutils-2.18/bfd/archures.c
--- binutils-2.18.orig/bfd/archures.c   2007-08-06 22:59:14.000000000 +0300
+++ binutils-2.18/bfd/archures.c        2008-05-25 16:57:13.406250000 +0300
@@ -374,7 +374,9 @@
 .#define bfd_mach_msp14          14
 .#define bfd_mach_msp15          15
 .#define bfd_mach_msp16          16
+.#define bfd_mach_msp20          20
 .#define bfd_mach_msp21          21
+.#define bfd_mach_msp22          22
 .#define bfd_mach_msp31          31
 .#define bfd_mach_msp32          32
 .#define bfd_mach_msp33          33
@@ -382,6 +384,7 @@
 .#define bfd_mach_msp42          42
 .#define bfd_mach_msp43          43
 .#define bfd_mach_msp44          44
+.#define bfd_mach_msp46          46
 .  bfd_arch_xc16x,     {* Infineon's XC16X Series.               *}
 .#define bfd_mach_xc16x         1
 .#define bfd_mach_xc16xl        2
diff -ur binutils-2.18.orig/bfd/bfd-in2.h binutils-2.18/bfd/bfd-in2.h
--- binutils-2.18.orig/bfd/bfd-in2.h    2007-08-06 22:59:15.000000000 +0300
+++ binutils-2.18/bfd/bfd-in2.h 2008-05-25 16:57:13.437500000 +0300
@@ -2045,7 +2045,9 @@
 #define bfd_mach_msp14          14
 #define bfd_mach_msp15          15
 #define bfd_mach_msp16          16
+#define bfd_mach_msp20          20
 #define bfd_mach_msp21          21
+#define bfd_mach_msp22          22
 #define bfd_mach_msp31          31
 #define bfd_mach_msp32          32
 #define bfd_mach_msp33          33
@@ -2053,6 +2055,7 @@
 #define bfd_mach_msp42          42
 #define bfd_mach_msp43          43
 #define bfd_mach_msp44          44
+#define bfd_mach_msp46          46
   bfd_arch_xc16x,     /* Infineon's XC16X Series.               */
 #define bfd_mach_xc16x         1
 #define bfd_mach_xc16xl        2
diff -ur binutils-2.18.orig/bfd/cpu-msp430.c binutils-2.18/bfd/cpu-msp430.c
--- binutils-2.18.orig/bfd/cpu-msp430.c 2007-08-06 22:59:20.000000000 +0300
+++ binutils-2.18/bfd/cpu-msp430.c      2008-05-25 16:57:13.437500000 +0300
@@ -65,29 +65,38 @@
   /* 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[8]),
+  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]),
 
   /* msp430x31x.  */
-  N (16, bfd_mach_msp31, "msp:31", FALSE, & arch_info_struct[9]), 
+  N (16, bfd_mach_msp31, "msp:31", FALSE, & arch_info_struct[11]), 
 
   /* msp430x32x.  */
-  N (16, bfd_mach_msp32, "msp:32", FALSE, & arch_info_struct[10]), 
+  N (16, bfd_mach_msp32, "msp:32", FALSE, & arch_info_struct[12]), 
 
   /* msp430x33x.  */
-  N (16, bfd_mach_msp33, "msp:33", FALSE, & arch_info_struct[11]),
+  N (16, bfd_mach_msp33, "msp:33", FALSE, & arch_info_struct[13]),
   
   /* msp430x41x.  */
-  N (16, bfd_mach_msp41, "msp:41", FALSE, & arch_info_struct[12]),
+  N (16, bfd_mach_msp41, "msp:41", FALSE, & arch_info_struct[14]),
 
   /* msp430x42x.  */
-  N (16, bfd_mach_msp42, "msp:42", FALSE, & arch_info_struct[13]),
+  N (16, bfd_mach_msp42, "msp:42", FALSE, & arch_info_struct[15]),
 
   /* msp430x43x.  */
-  N (16, bfd_mach_msp43, "msp:43", FALSE, & arch_info_struct[14]),
+  N (16, bfd_mach_msp43, "msp:43", FALSE, & arch_info_struct[16]),
 
   /* msp430x44x.  */
-  N (16, bfd_mach_msp43, "msp:44", FALSE, NULL)
+  N (16, bfd_mach_msp44, "msp:44", FALSE, & arch_info_struct[17]),
+
+  /* msp430x46xx.  */
+  N (16, bfd_mach_msp46, "msp:46", FALSE, NULL)
 };
 
 const bfd_arch_info_type bfd_msp430_arch =
diff -ur binutils-2.18.orig/bfd/doc/archures.texi 
binutils-2.18/bfd/doc/archures.texi
--- binutils-2.18.orig/bfd/doc/archures.texi    2007-08-06 23:39:25.000000000 
+0300
+++ binutils-2.18/bfd/doc/archures.texi 2008-05-25 16:57:13.453125000 +0300
@@ -339,7 +339,9 @@
 #define bfd_mach_msp14          14
 #define bfd_mach_msp15          15
 #define bfd_mach_msp16          16
+#define bfd_mach_msp20          20
 #define bfd_mach_msp21          21
+#define bfd_mach_msp22          22
 #define bfd_mach_msp31          31
 #define bfd_mach_msp32          32
 #define bfd_mach_msp33          33
@@ -347,6 +349,7 @@
 #define bfd_mach_msp42          42
 #define bfd_mach_msp43          43
 #define bfd_mach_msp44          44
+#define bfd_mach_msp46          46
   bfd_arch_xc16x,     /* Infineon's XC16X Series.               */
 #define bfd_mach_xc16x         1
 #define bfd_mach_xc16xl        2
diff -ur binutils-2.18.orig/bfd/elf32-msp430.c binutils-2.18/bfd/elf32-msp430.c
--- binutils-2.18.orig/bfd/elf32-msp430.c       2007-08-06 22:59:28.000000000 
+0300
+++ binutils-2.18/bfd/elf32-msp430.c    2008-05-25 16:57:13.468750000 +0300
@@ -564,6 +564,18 @@
       val = E_MSP430_MACH_MSP430x16;
       break;
 
+    case bfd_mach_msp20:
+      val = E_MSP430_MACH_MSP430x20;
+      break;
+
+    case bfd_mach_msp21:
+      val = E_MSP430_MACH_MSP430x21;
+      break;
+
+    case bfd_mach_msp22:
+      val = E_MSP430_MACH_MSP430x22;
+      break;
+
     case bfd_mach_msp31:
       val = E_MSP430_MACH_MSP430x31;
       break;
@@ -591,6 +603,10 @@
     case bfd_mach_msp44:
       val = E_MSP430_MACH_MSP430x44;
       break;
+
+    case bfd_mach_msp46:
+      val = E_MSP430_MACH_MSP430x46;
+      break;
     }
 
   elf_elfheader (abfd)->e_machine = EM_MSP430;
@@ -641,6 +657,18 @@
          e_set = bfd_mach_msp16;
          break;
 
+       case E_MSP430_MACH_MSP430x20:
+         e_set = bfd_mach_msp20;
+         break;
+
+       case E_MSP430_MACH_MSP430x21:
+         e_set = bfd_mach_msp21;
+         break;
+
+       case E_MSP430_MACH_MSP430x22:
+         e_set = bfd_mach_msp22;
+         break;
+
        case E_MSP430_MACH_MSP430x31:
          e_set = bfd_mach_msp31;
          break;
@@ -668,6 +696,10 @@
        case E_MSP430_MACH_MSP430x44:
          e_set = bfd_mach_msp44;
          break;
+
+       case E_MSP430_MACH_MSP430x46:
+         e_set = bfd_mach_msp46;
+         break;
        }
     }
 
diff -ur binutils-2.18.orig/gas/config/tc-msp430.c 
binutils-2.18/gas/config/tc-msp430.c
--- binutils-2.18.orig/gas/config/tc-msp430.c   2007-08-06 23:00:02.000000000 
+0300
+++ binutils-2.18/gas/config/tc-msp430.c        2008-05-25 16:57:13.484375000 
+0300
@@ -247,7 +247,9 @@
 #define MSP430_ISA_14   14
 #define MSP430_ISA_15   15
 #define MSP430_ISA_16   16
+#define MSP430_ISA_20   20
 #define MSP430_ISA_21   21
+#define MSP430_ISA_22   22
 #define MSP430_ISA_31   31
 #define MSP430_ISA_32   32
 #define MSP430_ISA_33   33
@@ -255,83 +257,113 @@
 #define MSP430_ISA_42   42
 #define MSP430_ISA_43   43
 #define MSP430_ISA_44   44
+#define MSP430_ISA_46   46
 
 #define CHECK_RELOC_MSP430             ((imm_op || 
byte_op)?BFD_RELOC_MSP430_16_BYTE:BFD_RELOC_MSP430_16)
 #define CHECK_RELOC_MSP430_PCREL       ((imm_op || 
byte_op)?BFD_RELOC_MSP430_16_PCREL_BYTE:BFD_RELOC_MSP430_16_PCREL)
 
 static struct mcu_type_s mcu_types[] =
 {
-  {"msp1",        MSP430_ISA_11, bfd_mach_msp11},
-  {"msp2",        MSP430_ISA_14, bfd_mach_msp14},
-  {"msp430x110",  MSP430_ISA_11, bfd_mach_msp11},
-  {"msp430x112",  MSP430_ISA_11, bfd_mach_msp11},
-  {"msp430x1101", MSP430_ISA_110, bfd_mach_msp110},
-  {"msp430x1111", MSP430_ISA_110, bfd_mach_msp110},
-  {"msp430x1121", MSP430_ISA_110, bfd_mach_msp110},
-  {"msp430x1122", MSP430_ISA_11, bfd_mach_msp110},
-  {"msp430x1132", MSP430_ISA_11, bfd_mach_msp110},
-
-  {"msp430x122",  MSP430_ISA_12, bfd_mach_msp12},
-  {"msp430x123",  MSP430_ISA_12, bfd_mach_msp12},
-  {"msp430x1222", MSP430_ISA_12, bfd_mach_msp12},
-  {"msp430x1232", MSP430_ISA_12, bfd_mach_msp12},
-
-  {"msp430x133",  MSP430_ISA_13, bfd_mach_msp13},
-  {"msp430x135",  MSP430_ISA_13, bfd_mach_msp13},
-  {"msp430x1331", MSP430_ISA_13, bfd_mach_msp13},
-  {"msp430x1351", MSP430_ISA_13, bfd_mach_msp13},
-  {"msp430x147",  MSP430_ISA_14, bfd_mach_msp14},
-  {"msp430x148",  MSP430_ISA_14, bfd_mach_msp14},
-  {"msp430x149",  MSP430_ISA_14, bfd_mach_msp14},
-
-  {"msp430x155",  MSP430_ISA_15, bfd_mach_msp15},
-  {"msp430x156",  MSP430_ISA_15, bfd_mach_msp15},
-  {"msp430x157",  MSP430_ISA_15, bfd_mach_msp15},
-  {"msp430x167",  MSP430_ISA_16, bfd_mach_msp16},
-  {"msp430x168",  MSP430_ISA_16, bfd_mach_msp16},
-  {"msp430x169",  MSP430_ISA_16, bfd_mach_msp16},
-  {"msp430x1610", MSP430_ISA_16, bfd_mach_msp16},
-  {"msp430x1611", MSP430_ISA_16, bfd_mach_msp16},
-  {"msp430x1612", MSP430_ISA_16, bfd_mach_msp16},
-
-  {"msp430x2101", MSP430_ISA_21, bfd_mach_msp21},
-  {"msp430x2111", MSP430_ISA_21, bfd_mach_msp21},
-  {"msp430x2121", MSP430_ISA_21, bfd_mach_msp21},
-  {"msp430x2131", MSP430_ISA_21, bfd_mach_msp21},
+  {"msp1",         MSP430_ISA_11,  bfd_mach_msp11},
+  {"msp2",         MSP430_ISA_14,  bfd_mach_msp14},
+  {"msp430x110",   MSP430_ISA_11,  bfd_mach_msp11},
+  {"msp430x112",   MSP430_ISA_11,  bfd_mach_msp11},
+  {"msp430x1101",  MSP430_ISA_110, bfd_mach_msp110},
+  {"msp430x1111",  MSP430_ISA_110, bfd_mach_msp110},
+  {"msp430x1121",  MSP430_ISA_110, bfd_mach_msp110},
+  {"msp430x1122",  MSP430_ISA_11,  bfd_mach_msp110},
+  {"msp430x1132",  MSP430_ISA_11,  bfd_mach_msp110},
+
+  {"msp430x122",   MSP430_ISA_12,  bfd_mach_msp12},
+  {"msp430x123",   MSP430_ISA_12,  bfd_mach_msp12},
+  {"msp430x1222",  MSP430_ISA_12,  bfd_mach_msp12},
+  {"msp430x1232",  MSP430_ISA_12,  bfd_mach_msp12},
+
+  {"msp430x133",   MSP430_ISA_13,  bfd_mach_msp13},
+  {"msp430x135",   MSP430_ISA_13,  bfd_mach_msp13},
+  {"msp430x1331",  MSP430_ISA_13,  bfd_mach_msp13},
+  {"msp430x1351",  MSP430_ISA_13,  bfd_mach_msp13},
+  {"msp430x147",   MSP430_ISA_14,  bfd_mach_msp14},
+  {"msp430x148",   MSP430_ISA_14,  bfd_mach_msp14},
+  {"msp430x149",   MSP430_ISA_14,  bfd_mach_msp14},
+  {"msp430x1471",  MSP430_ISA_14,  bfd_mach_msp14},
+  {"msp430x1481",  MSP430_ISA_14,  bfd_mach_msp14},
+  {"msp430x1491",  MSP430_ISA_14,  bfd_mach_msp14},
+
+  {"msp430x155",   MSP430_ISA_15,  bfd_mach_msp15},
+  {"msp430x156",   MSP430_ISA_15,  bfd_mach_msp15},
+  {"msp430x157",   MSP430_ISA_15,  bfd_mach_msp15},
+  {"msp430x167",   MSP430_ISA_16,  bfd_mach_msp16},
+  {"msp430x168",   MSP430_ISA_16,  bfd_mach_msp16},
+  {"msp430x169",   MSP430_ISA_16,  bfd_mach_msp16},
+  {"msp430x1610",  MSP430_ISA_16,  bfd_mach_msp16},
+  {"msp430x1611",  MSP430_ISA_16,  bfd_mach_msp16},
+  {"msp430x1612",  MSP430_ISA_16,  bfd_mach_msp16},
+
+  {"msp430x2001",  MSP430_ISA_20,  bfd_mach_msp20},
+  {"msp430x2011",  MSP430_ISA_20,  bfd_mach_msp20},
+
+  {"msp430x2002",  MSP430_ISA_20,  bfd_mach_msp20},
+  {"msp430x2012",  MSP430_ISA_20,  bfd_mach_msp20},
+
+  {"msp430x2003",  MSP430_ISA_20,  bfd_mach_msp20},
+  {"msp430x2013",  MSP430_ISA_20,  bfd_mach_msp20},
+
+  {"msp430x2101",  MSP430_ISA_21,  bfd_mach_msp21},
+  {"msp430x2111",  MSP430_ISA_21,  bfd_mach_msp21},
+  {"msp430x2121",  MSP430_ISA_21,  bfd_mach_msp21},
+  {"msp430x2131",  MSP430_ISA_21,  bfd_mach_msp21},
+
+  {"msp430x2234",  MSP430_ISA_22,  bfd_mach_msp22},
+  {"msp430x2254",  MSP430_ISA_22,  bfd_mach_msp22},
+  {"msp430x2274",  MSP430_ISA_22,  bfd_mach_msp22},
   
-  {"msp430x311",  MSP430_ISA_31, bfd_mach_msp31},
-  {"msp430x312",  MSP430_ISA_31, bfd_mach_msp31},
-  {"msp430x313",  MSP430_ISA_31, bfd_mach_msp31},
-  {"msp430x314",  MSP430_ISA_31, bfd_mach_msp31},
-  {"msp430x315",  MSP430_ISA_31, bfd_mach_msp31},
-  {"msp430x323",  MSP430_ISA_32, bfd_mach_msp32},
-  {"msp430x325",  MSP430_ISA_32, bfd_mach_msp32},
-  {"msp430x336",  MSP430_ISA_33, bfd_mach_msp33},
-  {"msp430x337",  MSP430_ISA_33, bfd_mach_msp33},
-
-  {"msp430x412",  MSP430_ISA_41, bfd_mach_msp41},
-  {"msp430x413",  MSP430_ISA_41, bfd_mach_msp41},
-  {"msp430x415",  MSP430_ISA_41, bfd_mach_msp41},
-  {"msp430x417",  MSP430_ISA_41, bfd_mach_msp41},
-
-  {"msp430xE423", MSP430_ISA_42, bfd_mach_msp42},
-  {"msp430xE425", MSP430_ISA_42, bfd_mach_msp42},
-  {"msp430xE427", MSP430_ISA_42, bfd_mach_msp42},
-
-  {"msp430xW423", MSP430_ISA_42, bfd_mach_msp42},
-  {"msp430xW425", MSP430_ISA_42, bfd_mach_msp42},
-  {"msp430xW427", MSP430_ISA_42, bfd_mach_msp42},
-
-  {"msp430xG437", MSP430_ISA_43, bfd_mach_msp43},
-  {"msp430xG438", MSP430_ISA_43, bfd_mach_msp43},
-  {"msp430xG439", MSP430_ISA_43, bfd_mach_msp43},
-
-  {"msp430x435",  MSP430_ISA_43, bfd_mach_msp43},
-  {"msp430x436",  MSP430_ISA_43, bfd_mach_msp43},
-  {"msp430x437",  MSP430_ISA_43, bfd_mach_msp43},
-  {"msp430x447",  MSP430_ISA_44, bfd_mach_msp44},
-  {"msp430x448",  MSP430_ISA_44, bfd_mach_msp44},
-  {"msp430x449",  MSP430_ISA_44, bfd_mach_msp44},
+  {"msp430x311",   MSP430_ISA_31,  bfd_mach_msp31},
+  {"msp430x312",   MSP430_ISA_31,  bfd_mach_msp31},
+  {"msp430x313",   MSP430_ISA_31,  bfd_mach_msp31},
+  {"msp430x314",   MSP430_ISA_31,  bfd_mach_msp31},
+  {"msp430x315",   MSP430_ISA_31,  bfd_mach_msp31},
+  {"msp430x323",   MSP430_ISA_32,  bfd_mach_msp32},
+  {"msp430x325",   MSP430_ISA_32,  bfd_mach_msp32},
+  {"msp430x336",   MSP430_ISA_33,  bfd_mach_msp33},
+  {"msp430x337",   MSP430_ISA_33,  bfd_mach_msp33},
+
+  {"msp430x412",   MSP430_ISA_41,  bfd_mach_msp41},
+  {"msp430x413",   MSP430_ISA_41,  bfd_mach_msp41},
+  {"msp430x415",   MSP430_ISA_41,  bfd_mach_msp41},
+  {"msp430x417",   MSP430_ISA_41,  bfd_mach_msp41},
+
+  {"msp430x423",   MSP430_ISA_42,  bfd_mach_msp42},
+  {"msp430x425",   MSP430_ISA_42,  bfd_mach_msp42},
+  {"msp430x427",   MSP430_ISA_42,  bfd_mach_msp42},
+
+  {"msp430x4250",  MSP430_ISA_42,  bfd_mach_msp42},
+  {"msp430x4260",  MSP430_ISA_42,  bfd_mach_msp42},
+  {"msp430x4270",  MSP430_ISA_42,  bfd_mach_msp42},
+
+  {"msp430xE423",  MSP430_ISA_42,  bfd_mach_msp42},
+  {"msp430xE425",  MSP430_ISA_42,  bfd_mach_msp42},
+  {"msp430xE427",  MSP430_ISA_42,  bfd_mach_msp42},
+
+  {"msp430xW423",  MSP430_ISA_42,  bfd_mach_msp42},
+  {"msp430xW425",  MSP430_ISA_42,  bfd_mach_msp42},
+  {"msp430xW427",  MSP430_ISA_42,  bfd_mach_msp42},
+
+  {"msp430xG437",  MSP430_ISA_43,  bfd_mach_msp43},
+  {"msp430xG438",  MSP430_ISA_43,  bfd_mach_msp43},
+  {"msp430xG439",  MSP430_ISA_43,  bfd_mach_msp43},
+
+  {"msp430x435",   MSP430_ISA_43,  bfd_mach_msp43},
+  {"msp430x436",   MSP430_ISA_43,  bfd_mach_msp43},
+  {"msp430x437",   MSP430_ISA_43,  bfd_mach_msp43},
+  {"msp430x447",   MSP430_ISA_44,  bfd_mach_msp44},
+  {"msp430x448",   MSP430_ISA_44,  bfd_mach_msp44},
+  {"msp430x449",   MSP430_ISA_44,  bfd_mach_msp44},
+
+  {"msp430xG4616", MSP430_ISA_46,  bfd_mach_msp46},
+  {"msp430xG4617", MSP430_ISA_46,  bfd_mach_msp46},
+  {"msp430xG4618", MSP430_ISA_46,  bfd_mach_msp46},
+  {"msp430xG4619", MSP430_ISA_46,  bfd_mach_msp46},
 
   {NULL, 0, 0}
 };
@@ -795,26 +827,35 @@
   fprintf (stream,
           _("MSP430 options:\n"
             "  -mmcu=[msp430-name] select microcontroller type\n"
-            "                  msp430x110  msp430x112\n"
-            "                  msp430x1101 msp430x1111\n"
-            "                  msp430x1121 msp430x1122 msp430x1132\n"
-            "                  msp430x122  msp430x123\n"
-            "                  msp430x1222 msp430x1232\n"
-            "                  msp430x133  msp430x135\n"
-            "                  msp430x1331 msp430x1351\n"
-            "                  msp430x147  msp430x148  msp430x149\n"
-            "                  msp430x155  msp430x156  msp430x157\n"
-            "                  msp430x167  msp430x168  msp430x169\n"
-            "                  msp430x1610 msp430x1611 msp430x1612\n"
-            "                  msp430x311  msp430x312  msp430x313  msp430x314  
msp430x315\n"
-            "                  msp430x323  msp430x325\n"
-            "                  msp430x336  msp430x337\n"
-            "                  msp430x412  msp430x413  msp430x415  
msp430x417\n"
-            "                  msp430xE423 msp430xE425 msp430E427\n"
-            "                  msp430xW423 msp430xW425 msp430W427\n"
-            "                  msp430xG437 msp430xG438 msp430G439\n"
-            "                  msp430x435  msp430x436  msp430x437\n"
-            "                  msp430x447  msp430x448  msp430x449\n"));
+            "                  msp430x110   msp430x112\n"
+            "                  msp430x1101  msp430x1111  msp430x1121\n"
+            "                  msp430x1122  msp430x1132\n"
+            "                  msp430x122   msp430x123\n"
+            "                  msp430x1222  msp430x1232\n"
+            "                  msp430x133   msp430x135\n"
+            "                  msp430x1331  msp430x1351\n"
+            "                  msp430x147   msp430x148   msp430x149\n"
+            "                  msp430x1471  msp430x1481  msp430x1491\n"
+            "                  msp430x155   msp430x156   msp430x157\n"
+            "                  msp430x167   msp430x168   msp430x169\n"
+            "                  msp430x1610  msp430x1611  msp430x1612\n"
+            "                  msp430x2001  msp430x2011\n"
+            "                  msp430x2002  msp430x2012\n"
+            "                  msp430x2003  msp430x2013\n"
+            "                  msp430x2101  msp430x2111  msp430x2121  
msp430x2131\n"
+            "                  msp430x2234  msp430x2254  msp430x2274\n"
+            "                  msp430x311   msp430x312   msp430x313   
msp430x314  msp430x315\n"
+            "                  msp430x323   msp430x325\n" 
+            "                  msp430x336   msp430x337\n"
+            "                  msp430x412   msp430x413   msp430x415   
msp430x417\n"
+            "                  msp430x423   msp430x425   msp430427\n"
+            "                  msp430x4250  msp430x4260  msp4304270\n"
+            "                  msp430xE423  msp430xE425  msp430E427\n"
+            "                  msp430xW423  msp430xW425  msp430W427\n"
+            "                  msp430xG437  msp430xG438  msp430G439\n"
+            "                  msp430x435   msp430x436   msp430x437\n"
+            "                  msp430x447   msp430x448   msp430x449\n"
+            "                  msp430xG4616 msp430xG4617 msp430xG4618 
msp430xG4619\n"));
   fprintf (stream,
           _("  -mQ - enable relaxation at assembly time. DANGEROUS!\n"
             "  -mP - enable polymorph instructions\n"));
diff -ur binutils-2.18.orig/include/elf/msp430.h 
binutils-2.18/include/elf/msp430.h
--- binutils-2.18.orig/include/elf/msp430.h     2005-05-10 13:21:10.000000000 
+0300
+++ binutils-2.18/include/elf/msp430.h  2008-05-25 16:57:13.484375000 +0300
@@ -26,20 +26,24 @@
 /* Processor specific flags for the ELF header e_flags field.  */
 #define EF_MSP430_MACH                 0xff
 
-#define E_MSP430_MACH_MSP430x11  11
-#define E_MSP430_MACH_MSP430x11x1  110
-#define E_MSP430_MACH_MSP430x12  12
-#define E_MSP430_MACH_MSP430x13  13
-#define E_MSP430_MACH_MSP430x14  14
-#define E_MSP430_MACH_MSP430x15  15
-#define E_MSP430_MACH_MSP430x16  16
-#define E_MSP430_MACH_MSP430x31  31
-#define E_MSP430_MACH_MSP430x32  32
-#define E_MSP430_MACH_MSP430x33  33
-#define E_MSP430_MACH_MSP430x41  41
-#define E_MSP430_MACH_MSP430x42  42
-#define E_MSP430_MACH_MSP430x43  43
-#define E_MSP430_MACH_MSP430x44  44
+#define E_MSP430_MACH_MSP430x11   11
+#define E_MSP430_MACH_MSP430x11x1 110
+#define E_MSP430_MACH_MSP430x12   12
+#define E_MSP430_MACH_MSP430x13   13
+#define E_MSP430_MACH_MSP430x14   14
+#define E_MSP430_MACH_MSP430x15   15
+#define E_MSP430_MACH_MSP430x16   16
+#define E_MSP430_MACH_MSP430x20   20
+#define E_MSP430_MACH_MSP430x21   21
+#define E_MSP430_MACH_MSP430x22   22
+#define E_MSP430_MACH_MSP430x31   31
+#define E_MSP430_MACH_MSP430x32   32
+#define E_MSP430_MACH_MSP430x33   33
+#define E_MSP430_MACH_MSP430x41   41
+#define E_MSP430_MACH_MSP430x42   42
+#define E_MSP430_MACH_MSP430x43   43
+#define E_MSP430_MACH_MSP430x44   44
+#define E_MSP430_MACH_MSP430x46   46
 
 /* Relocations.  */
 START_RELOC_NUMBERS (elf_msp430_reloc_type)
diff -ur binutils-2.18.orig/ld/Makefile.am binutils-2.18/ld/Makefile.am
--- binutils-2.18.orig/ld/Makefile.am   2007-08-06 23:00:17.000000000 +0300
+++ binutils-2.18/ld/Makefile.am        2008-05-25 16:57:13.531250000 +0300
@@ -296,6 +296,9 @@
        emsp430x147.o \
        emsp430x148.o \
        emsp430x149.o \
+       emsp430x1471.o \
+       emsp430x1481.o \
+       emsp430x1491.o \
        emsp430x155.o \
        emsp430x156.o \
        emsp430x157.o \
@@ -305,10 +308,19 @@
        emsp430x1610.o \
        emsp430x1611.o \
        emsp430x1612.o \
+       emsp430x2001.o \
+       emsp430x2011.o \
+       emsp430x2002.o \
+       emsp430x2012.o \
+       emsp430x2003.o \
+       emsp430x2014.o \
        emsp430x2101.o \
        emsp430x2111.o \
        emsp430x2121.o \
        emsp430x2131.o \
+       emsp430x2234.o \
+       emsp430x2254.o \
+       emsp430x2274.o \
        emsp430x311.o \
        emsp430x312.o \
        emsp430x313.o \
@@ -322,6 +334,12 @@
        emsp430x413.o \
        emsp430x415.o \
        emsp430x417.o \
+       emsp430x423.o \
+       emsp430x425.o \
+       emsp430x427.o \
+       emsp430x4250.o \
+       emsp430x4260.o \
+       emsp430x4270.o \
        emsp430xE423.o \
        emsp430xE425.o \
        emsp430xE427.o \
@@ -337,6 +355,10 @@
        emsp430x447.o \
        emsp430x448.o \
        emsp430x449.o \
+       emsp430xG4616.o \
+       emsp430xG4617.o \
+       emsp430xG4618.o \
+       emsp430xG4619.o \
        enews.o \
        ens32knbsd.o \
        eor32.o \
@@ -1311,6 +1333,18 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" msp430all
+emsp430x1471.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x1471 "$(tdir_msp430x1471)" msp430all
+emsp430x1481.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x1481 "$(tdir_msp430x1481)" msp430all
+emsp430x1491.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x1491 "$(tdir_msp430x1491)" msp430all
 emsp430x155.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
@@ -1347,6 +1381,30 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x1612 "$(tdir_msp430x1612)" msp430all
+emsp430x2001.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2001 "$(tdir_msp430x2001)" msp430all
+emsp430x2011.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2011 "$(tdir_msp430x2011)" msp430all
+emsp430x2002.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2002 "$(tdir_msp430x2002)" msp430all
+emsp430x2012.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2012 "$(tdir_msp430x2012)" msp430all
+emsp430x2003.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2003 "$(tdir_msp430x2003)" msp430all
+emsp430x2013.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2013 "$(tdir_msp430x2013)" msp430all
 emsp430x2101.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
@@ -1363,6 +1421,18 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x2131 "$(tdir_msp430x2131)" msp430all
+emsp430x2234.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2234 "$(tdir_msp430x2234)" msp430all
+emsp430x2254.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2254 "$(tdir_msp430x2254)" msp430all
+emsp430x2274.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2274 "$(tdir_msp430x2274)" msp430all
 emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
   ${GEN_DEPENDS}
@@ -1415,6 +1485,30 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x417 "$(tdir_msp430x417)" msp430all
+emsp430x423.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x423 "$(tdir_msp430x423)" msp430all
+emsp430x425.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x425 "$(tdir_msp430x425)" msp430all
+emsp430x427.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x427 "$(tdir_msp430x427)" msp430all
+emsp430x4250.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x4250 "$(tdir_msp430x4250)" msp430all
+emsp430x4260.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x4260 "$(tdir_msp430x4260)" msp430all
+emsp430x4270.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x4270 "$(tdir_msp430x4270)" msp430all
 emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
@@ -1475,6 +1569,22 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" msp430all
+emsp430xG4616.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430xG4616 "$(tdir_msp430xG4616)" msp430all
+emsp430xG4617.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430xG4617 "$(tdir_msp430xG4617)" msp430all
+emsp430xG4618.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430xG4618 "$(tdir_msp430xG4618)" msp430all
+emsp430xG4619.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430xG4619 "$(tdir_msp430xG4619)" msp430all
 enews.c: $(srcdir)/emulparams/news.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} news "$(tdir_news)"
diff -ur binutils-2.18.orig/ld/Makefile.in binutils-2.18/ld/Makefile.in
--- binutils-2.18.orig/ld/Makefile.in   2007-08-06 23:29:54.000000000 +0300
+++ binutils-2.18/ld/Makefile.in        2008-05-25 16:57:13.546875000 +0300
@@ -543,6 +543,9 @@
        emsp430x147.o \
        emsp430x148.o \
        emsp430x149.o \
+       emsp430x1471.o \
+       emsp430x1481.o \
+       emsp430x1491.o \
        emsp430x155.o \
        emsp430x156.o \
        emsp430x157.o \
@@ -552,10 +555,19 @@
        emsp430x1610.o \
        emsp430x1611.o \
        emsp430x1612.o \
+       emsp430x2001.o \
+       emsp430x2011.o \
+       emsp430x2002.o \
+       emsp430x2012.o \
+       emsp430x2003.o \
+       emsp430x2013.o \
        emsp430x2101.o \
        emsp430x2111.o \
        emsp430x2121.o \
        emsp430x2131.o \
+       emsp430x2234.o \
+       emsp430x2254.o \
+       emsp430x2274.o \
        emsp430x311.o \
        emsp430x312.o \
        emsp430x313.o \
@@ -569,6 +581,12 @@
        emsp430x413.o \
        emsp430x415.o \
        emsp430x417.o \
+       emsp430x423.o \
+       emsp430x425.o \
+       emsp430x427.o \
+       emsp430x4250.o \
+       emsp430x4260.o \
+       emsp430x4270.o \
        emsp430xE423.o \
        emsp430xE425.o \
        emsp430xE427.o \
@@ -584,6 +602,10 @@
        emsp430x447.o \
        emsp430x448.o \
        emsp430x449.o \
+       emsp430xG4616.o \
+       emsp430xG4617.o \
+       emsp430xG4618.o \
+       emsp430xG4619.o \
        enews.o \
        ens32knbsd.o \
        eor32.o \
@@ -2137,6 +2159,18 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" msp430all
+emsp430x1471.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x1471 "$(tdir_msp430x1471)" msp430all
+emsp430x1481.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x1481 "$(tdir_msp430x1481)" msp430all
+emsp430x1491.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x1491 "$(tdir_msp430x1491)" msp430all
 emsp430x155.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
@@ -2173,6 +2207,30 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x1612 "$(tdir_msp430x1612)" msp430all
+emsp430x2001.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2001 "$(tdir_msp430x2001)" msp430all
+emsp430x2011.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2011 "$(tdir_msp430x2011)" msp430all
+emsp430x2002.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2002 "$(tdir_msp430x2002)" msp430all
+emsp430x2012.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2012 "$(tdir_msp430x2012)" msp430all
+emsp430x2003.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2003 "$(tdir_msp430x2003)" msp430all
+emsp430x2013.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2013 "$(tdir_msp430x2013)" msp430all
 emsp430x2101.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
@@ -2189,6 +2247,18 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x2131 "$(tdir_msp430x2131)" msp430all
+emsp430x2234.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2234 "$(tdir_msp430x2234)" msp430all
+emsp430x2254.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2254 "$(tdir_msp430x2254)" msp430all
+emsp430x2274.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2274 "$(tdir_msp430x2274)" msp430all
 emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
   ${GEN_DEPENDS}
@@ -2241,6 +2311,30 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x417 "$(tdir_msp430x417)" msp430all
+emsp430x423.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x423 "$(tdir_msp430x423)" msp430all
+emsp430x425.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x425 "$(tdir_msp430x425)" msp430all
+emsp430x427.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x427 "$(tdir_msp430x427)" msp430all
+emsp430x4250.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x4250 "$(tdir_msp430x4250)" msp430all
+emsp430x4260.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x4260 "$(tdir_msp430x4260)" msp430all
+emsp430x4270.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x4270 "$(tdir_msp430x4270)" msp430all
 emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
@@ -2301,6 +2395,22 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" msp430all
+emsp430xG4616.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430xG4616 "$(tdir_msp430xG4616)" msp430all
+emsp430xG4617.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430xG4617 "$(tdir_msp430xG4617)" msp430all
+emsp430xG4618.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430xG4618 "$(tdir_msp430xG4618)" msp430all
+emsp430xG4619.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430xG4619 "$(tdir_msp430xG4619)" msp430all
 enews.c: $(srcdir)/emulparams/news.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
        ${GENSCRIPTS} news "$(tdir_news)"
diff -ur binutils-2.18.orig/ld/configure.tgt binutils-2.18/ld/configure.tgt
--- binutils-2.18.orig/ld/configure.tgt 2007-08-28 20:19:42.000000000 +0300
+++ binutils-2.18/ld/configure.tgt      2008-05-25 16:57:13.500000000 +0300
@@ -407,7 +407,7 @@
 mt-*elf)                targ_emul=elf32mt
                        ;;
 msp430-*-*)             targ_emul=msp430x110
-                        targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 
msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 
msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 
msp430x149 msp430x155 msp430x156 msp430x157 msp430x167 msp430x168 msp430x169 
msp430x1610 msp430x1611 msp430x1612 msp430x2101 msp430x2111 msp430x2121 
msp430x2131 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 
msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430x415 msp430x417 
msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 
msp430xG437 msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447 
msp430x448 msp430x449"
+                        targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 
msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 
msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 
msp430x149 msp430x1471 msp430x1481 msp430x1491 msp430x155 msp430x156 msp430x157 
msp430x167 msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 
msp430x2001 msp430x2011 msp430x2002 msp430x2012 msp430x2003 msp430x2013 
msp430x2101 msp430x2111 msp430x2121 msp430x2131 msp430x2234 msp430x2254 
msp430x2274 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 
msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430x415 msp430x417 
msp430x423 msp430x425 msp430x427 msp430x4250 msp430x4260 msp430x4270 
msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 
msp430xG437 msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447 
msp430x448 msp430x449 msp430xG4616 msp430xG4617 msp430xG4618 msp430xG4619"
                        ;;
 ns32k-pc532-mach* | ns32k-pc532-ux*)  targ_emul=pc532macha ;;
 ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd
diff -ur binutils-2.18.orig/ld/emulparams/msp430all.sh 
binutils-2.18/ld/emulparams/msp430all.sh
--- binutils-2.18.orig/ld/emulparams/msp430all.sh       2006-06-20 
05:22:14.000000000 +0300
+++ binutils-2.18/ld/emulparams/msp430all.sh    2008-05-25 16:57:13.515625000 
+0300
@@ -18,6 +18,8 @@
 ROM_SIZE=0x3e0
 RAM_START=0x0200
 RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x280
 fi
 
@@ -27,6 +29,8 @@
 ROM_SIZE=0x3e0
 RAM_START=0x0200
 RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x280
 fi
 
@@ -36,6 +40,8 @@
 ROM_SIZE=0x07e0
 RAM_START=0x0200
 RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x280
 fi
 
@@ -45,6 +51,8 @@
 ROM_SIZE=0xfe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -54,6 +62,8 @@
 ROM_SIZE=0x0fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -63,6 +73,8 @@
 ROM_SIZE=0x0fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -72,6 +84,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -81,6 +95,8 @@
 ROM_SIZE=0xfe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -90,6 +106,8 @@
 ROM_SIZE=0xfe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -99,6 +117,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -108,6 +128,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -117,6 +139,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -126,6 +150,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -135,6 +161,8 @@
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -144,6 +172,8 @@
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -153,6 +183,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1K
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -162,6 +194,8 @@
 ROM_SIZE=0xbfe0
 RAM_START=0x0200
 RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0xa00
 fi
 
@@ -171,6 +205,41 @@
 ROM_SIZE=0xeee0
 RAM_START=0x0200
 RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0xa00
+fi
+
+if [ "${MSP430_NAME}" = "msp430x1471" ] ; then
+ARCH=msp:14
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1K
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x600
+fi
+
+if [ "${MSP430_NAME}" = "msp430x1481" ] ; then
+ARCH=msp:14
+ROM_START=0x4000
+ROM_SIZE=0xbfe0
+RAM_START=0x0200
+RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0xa00
+fi
+
+if [ "${MSP430_NAME}" = "msp430x1491" ] ; then
+ARCH=msp:14
+ROM_START=0x1100
+ROM_SIZE=0xeee0
+RAM_START=0x0200
+RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0xa00
 fi
 
@@ -180,6 +249,8 @@
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -189,6 +260,8 @@
 ROM_SIZE=0x5fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -198,6 +271,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1K
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -207,6 +282,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1K
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -216,6 +293,8 @@
 ROM_SIZE=0xbfe0
 RAM_START=0x0200
 RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0xa00
 fi
 
@@ -225,6 +304,8 @@
 ROM_SIZE=0xeee0
 RAM_START=0x0200
 RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0xa00
 fi
 
@@ -234,6 +315,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x1100
 RAM_SIZE=0x1400
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x2500
 fi
 
@@ -243,6 +326,8 @@
 ROM_SIZE=0xbfe0
 RAM_START=0x1100
 RAM_SIZE=0x2800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x3900
 fi
 
@@ -252,15 +337,85 @@
 ROM_SIZE=0xdae0
 RAM_START=0x1100
 RAM_SIZE=0x1400
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x2500
 fi
 
+if [ "${MSP430_NAME}" = "msp430x2001" ] ; then
+ARCH=msp:20
+ROM_START=0xFC00
+ROM_SIZE=0x03e0
+RAM_START=0x0200
+RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x280
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2011" ] ; then
+ARCH=msp:20
+ROM_START=0xF800
+ROM_SIZE=0x07e0
+RAM_START=0x0200
+RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x280
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2002" ] ; then
+ARCH=msp:20
+ROM_START=0xFC00
+ROM_SIZE=0x03e0
+RAM_START=0x0200
+RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x280
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2012" ] ; then
+ARCH=msp:20
+ROM_START=0xF800
+ROM_SIZE=0x07e0
+RAM_START=0x0200
+RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x280
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2003" ] ; then
+ARCH=msp:20
+ROM_START=0xFC00
+ROM_SIZE=0x03e0
+RAM_START=0x0200
+RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x280
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2013" ] ; then
+ARCH=msp:20
+ROM_START=0xF800
+ROM_SIZE=0x07e0
+RAM_START=0x0200
+RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x280
+fi
+
 if [ "${MSP430_NAME}" = "msp430x2101" ] ; then
 ARCH=msp:21
 ROM_START=0xFC00
 ROM_SIZE=0x03e0
 RAM_START=0x0200
 RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x280
 fi
 
@@ -270,6 +425,8 @@
 ROM_SIZE=0x07e0
 RAM_START=0x0200
 RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x280
 fi
 
@@ -279,6 +436,8 @@
 ROM_SIZE=0x0fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -288,9 +447,44 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
+if [ "${MSP430_NAME}" = "msp430x2234" ] ; then
+ARCH=msp:22
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x300
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2254" ] ; then
+ARCH=msp:22
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x400
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2274" ] ; then
+ARCH=msp:22
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x600
+fi
+
 if [ "${MSP430_NAME}" = "msp430x311" ] ; then
 ARCH=msp:31
 SCRIPT_NAME=elf32msp430_3
@@ -298,6 +492,8 @@
 ROM_SIZE=0x07e0
 RAM_START=0x0200
 RAM_SIZE=128
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x280
 fi
 
@@ -308,6 +504,8 @@
 ROM_SIZE=0x0fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -318,6 +516,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -328,6 +528,8 @@
 ROM_SIZE=0x2fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -338,6 +540,8 @@
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -348,6 +552,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -358,6 +564,8 @@
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -368,6 +576,8 @@
 ROM_SIZE=0x5fe0
 RAM_START=0x0200
 RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -378,6 +588,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -387,6 +599,8 @@
 ROM_SIZE=0x0fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -396,6 +610,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -405,6 +621,8 @@
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -414,15 +632,85 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x600
+fi
+
+if [ "${MSP430_NAME}" = "msp430x423" ] ; then
+ARCH=msp:42
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x300
+fi
+
+if [ "${MSP430_NAME}" = "msp430x425" ] ; then
+ARCH=msp:42
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x400
+fi
+
+if [ "${MSP430_NAME}" = "msp430x427" ] ; then
+ARCH=msp:42
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
+if [ "${MSP430_NAME}" = "msp430x4250" ] ; then
+ARCH=msp:42
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x300
+fi
+
+if [ "${MSP430_NAME}" = "msp430x4260" ] ; then
+ARCH=msp:42
+ROM_START=0xa000
+ROM_SIZE=0x5fe0
+RAM_START=0x0200
+RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x300
+fi
+
+if [ "${MSP430_NAME}" = "msp430x4270" ] ; then
+ARCH=msp:42
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x300
+fi
+
 if [ "${MSP430_NAME}" = "msp430x435" ] ; then
 ARCH=msp:43
 ROM_START=0xc000
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -432,6 +720,8 @@
 ROM_SIZE=0x5fe0
 RAM_START=0x0200
 RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -441,6 +731,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -450,6 +742,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -459,6 +753,8 @@
 ROM_SIZE=0xbfe0
 RAM_START=0x0200
 RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0xa00
 fi
 
@@ -468,6 +764,8 @@
 ROM_SIZE=0xeee0
 RAM_START=0x0200
 RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0xa00
 fi
 
@@ -477,6 +775,8 @@
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -486,6 +786,8 @@
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -495,6 +797,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -504,6 +808,8 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=1024
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
 
@@ -513,6 +819,8 @@
 ROM_SIZE=0xbef0
 RAM_START=0x0200
 RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0xa00
 fi
 
@@ -522,15 +830,63 @@
 ROM_SIZE=0xeee0
 RAM_START=0x0200
 RAM_SIZE=0x0800
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0xa00
 fi
 
+if [ "${MSP430_NAME}" = "msp430xG4616" ] ; then
+ARCH=msp:46
+ROM_START=0x9100
+ROM_SIZE=0x6ec0
+RAM_START=0x1100
+RAM_SIZE=0x1000
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430xG4617" ] ; then
+ARCH=msp:46
+ROM_START=0x9100
+ROM_SIZE=0x6ec0
+RAM_START=0x1100
+RAM_SIZE=0x2000
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x3100
+fi
+
+if [ "${MSP430_NAME}" = "msp430xG4618" ] ; then
+ARCH=msp:46
+ROM_START=0x3100
+ROM_SIZE=0xcec0
+RAM_START=0x1100
+RAM_SIZE=0x2000
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x3100
+fi
+
+if [ "${MSP430_NAME}" = "msp430xG4619" ] ; then
+ARCH=msp:46
+ROM_START=0x2100
+ROM_SIZE=0xdec0
+RAM_START=0x1100
+RAM_SIZE=0x1000
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x2100
+fi
+
 if [ "${MSP430_NAME}" = "msp430xW423" ] ; then
 ARCH=msp:42
 ROM_START=0xe000
 ROM_SIZE=0x1fe0
 RAM_START=0x0200
 RAM_SIZE=256
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x300
 fi
 
@@ -540,6 +896,8 @@
 ROM_SIZE=0x3fe0
 RAM_START=0x0200
 RAM_SIZE=512
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x400
 fi
 
@@ -549,5 +907,7 @@
 ROM_SIZE=0x7fe0
 RAM_START=0x0200
 RAM_SIZE=0x400
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
 STACK=0x600
 fi
diff -ur binutils-2.18.orig/ld/scripttempl/elf32msp430.sc 
binutils-2.18/ld/scripttempl/elf32msp430.sc
--- binutils-2.18.orig/ld/scripttempl/elf32msp430.sc    2004-08-25 
15:54:10.000000000 +0300
+++ binutils-2.18/ld/scripttempl/elf32msp430.sc 2008-05-25 16:57:13.562500000 
+0300
@@ -24,12 +24,12 @@
 
 MEMORY
 {
-  text   (rx)          : ORIGIN = $ROM_START,  LENGTH = $ROM_SIZE
-  data   (rwx)         : ORIGIN = $RAM_START,  LENGTH = $RAM_SIZE
-  vectors (rw)         : ORIGIN = 0xffe0,      LENGTH = 0x20
-  bootloader(rx)       : ORIGIN = 0x0c00,      LENGTH = 1K
-  infomem(rx)          : ORIGIN = 0x1000,      LENGTH = 256
-  infomemnobits(rx)    : ORIGIN = 0x1000,      LENGTH = 256
+  text   (rx)          : ORIGIN = $ROM_START,    LENGTH = $ROM_SIZE
+  data   (rwx)         : ORIGIN = $RAM_START,    LENGTH = $RAM_SIZE
+  vectors (rw)         : ORIGIN = $VECTORS_START LENGTH = $VECTORS_SIZE
+  bootloader(rx)       : ORIGIN = 0x0c00,            LENGTH = 1K
+  infomem(rx)          : ORIGIN = 0x1000,            LENGTH = 256
+  infomemnobits(rx)    : ORIGIN = 0x1000,        LENGTH = 256
   ${HEAP_MEMORY_MSP430}
 }
 
diff -ur binutils-2.18.orig/ld/scripttempl/elf32msp430_3.sc 
binutils-2.18/ld/scripttempl/elf32msp430_3.sc
--- binutils-2.18.orig/ld/scripttempl/elf32msp430_3.sc  2003-04-09 
14:07:51.000000000 +0300
+++ binutils-2.18/ld/scripttempl/elf32msp430_3.sc       2008-05-25 
16:57:13.546875000 +0300
@@ -4,9 +4,9 @@
 
 MEMORY
 {
-  text   (rx)   : ORIGIN = $ROM_START,  LENGTH = $ROM_SIZE
-  data   (rwx)  : ORIGIN = $RAM_START,         LENGTH = $RAM_SIZE
-  vectors (rw)  : ORIGIN = 0xffe0,      LENGTH = 0x20
+  text   (rx)   : ORIGIN = $ROM_START,    LENGTH = $ROM_SIZE
+  data   (rwx)  : ORIGIN = $RAM_START,           LENGTH = $RAM_SIZE
+  vectors (rw)  : ORIGIN = $VECTORS_START LENGTH = $VECTORS_SIZE
 }
 
 SECTIONS
diff -ur binutils-2.18.orig/opcodes/msp430-dis.c 
binutils-2.18/opcodes/msp430-dis.c
--- binutils-2.18.orig/opcodes/msp430-dis.c     2007-08-06 22:59:07.000000000 
+0300
+++ binutils-2.18/opcodes/msp430-dis.c  2008-05-25 16:57:13.578125000 +0300
@@ -679,7 +679,9 @@
   insn = msp430dis_opcode (addr, info);
   sprintf (dinfo, "0x%04x", insn);
 
-  if (((int) addr & 0xffff) > 0xffdf)
+  if (((int) addr & 0xffff) >= 0xffe0
+      ||
+      (info->mach == 46  &&  ((int) addr & 0xffff) >= 0xffc0))
     {
       (*prin) (stream, "interrupt service routine at 0x%04x", 0xffff & insn);
       return 2;
diff -ur binutils-2.18.orig/bfd/archures.c binutils-2.18/bfd/archures.c
--- binutils-2.18.orig/bfd/archures.c   2008-05-25 16:57:13.406250000 +0300
+++ binutils-2.18/bfd/archures.c        2008-05-25 17:07:00.437500000 +0300
@@ -377,6 +377,9 @@
 .#define bfd_mach_msp20          20
 .#define bfd_mach_msp21          21
 .#define bfd_mach_msp22          22
+.#define bfd_mach_msp24          24
+.#define bfd_mach_msp241         241
+.#define bfd_mach_msp26          26
 .#define bfd_mach_msp31          31
 .#define bfd_mach_msp32          32
 .#define bfd_mach_msp33          33
diff -ur binutils-2.18.orig/bfd/bfd-in2.h binutils-2.18/bfd/bfd-in2.h
--- binutils-2.18.orig/bfd/bfd-in2.h    2008-05-25 16:57:13.437500000 +0300
+++ binutils-2.18/bfd/bfd-in2.h 2008-05-25 17:07:00.468750000 +0300
@@ -2048,6 +2048,9 @@
 #define bfd_mach_msp20          20
 #define bfd_mach_msp21          21
 #define bfd_mach_msp22          22
+#define bfd_mach_msp24          24
+#define bfd_mach_msp241         241
+#define bfd_mach_msp26          26
 #define bfd_mach_msp31          31
 #define bfd_mach_msp32          32
 #define bfd_mach_msp33          33
diff -ur binutils-2.18.orig/bfd/cpu-msp430.c binutils-2.18/bfd/cpu-msp430.c
--- binutils-2.18.orig/bfd/cpu-msp430.c 2008-05-25 16:57:13.437500000 +0300
+++ binutils-2.18/bfd/cpu-msp430.c      2008-05-25 17:07:00.484375000 +0300
@@ -74,26 +74,35 @@
   /* msp430x22x.  */
   N (16, bfd_mach_msp22, "msp:22", FALSE, & arch_info_struct[10]),
 
+  /* msp430x24x including msp430x2410 */
+  N (16, bfd_mach_msp24, "msp:24", FALSE, & arch_info_struct[11]),
+
+  /* msp430x241x except msp430x2410 (extended address range) */
+  N (16, bfd_mach_msp241, "msp:241", 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[11]), 
+  N (16, bfd_mach_msp31, "msp:31", FALSE, & arch_info_struct[14]), 
 
   /* msp430x32x.  */
-  N (16, bfd_mach_msp32, "msp:32", FALSE, & arch_info_struct[12]), 
+  N (16, bfd_mach_msp32, "msp:32", FALSE, & arch_info_struct[15]), 
 
   /* msp430x33x.  */
-  N (16, bfd_mach_msp33, "msp:33", FALSE, & arch_info_struct[13]),
+  N (16, bfd_mach_msp33, "msp:33", FALSE, & arch_info_struct[16]),
   
   /* msp430x41x.  */
-  N (16, bfd_mach_msp41, "msp:41", FALSE, & arch_info_struct[14]),
+  N (16, bfd_mach_msp41, "msp:41", FALSE, & arch_info_struct[17]),
 
   /* msp430x42x.  */
-  N (16, bfd_mach_msp42, "msp:42", FALSE, & arch_info_struct[15]),
+  N (16, bfd_mach_msp42, "msp:42", FALSE, & arch_info_struct[18]),
 
   /* msp430x43x.  */
-  N (16, bfd_mach_msp43, "msp:43", FALSE, & arch_info_struct[16]),
+  N (16, bfd_mach_msp43, "msp:43", FALSE, & arch_info_struct[19]),
 
   /* msp430x44x.  */
-  N (16, bfd_mach_msp44, "msp:44", FALSE, & arch_info_struct[17]),
+  N (16, bfd_mach_msp44, "msp:44", FALSE, & arch_info_struct[20]),
 
   /* msp430x46xx.  */
   N (16, bfd_mach_msp46, "msp:46", FALSE, NULL)
diff -ur binutils-2.18.orig/bfd/doc/archures.texi 
binutils-2.18/bfd/doc/archures.texi
--- binutils-2.18.orig/bfd/doc/archures.texi    2008-05-25 16:57:13.453125000 
+0300
+++ binutils-2.18/bfd/doc/archures.texi 2008-05-25 17:07:00.500000000 +0300
@@ -342,6 +342,9 @@
 #define bfd_mach_msp20          20
 #define bfd_mach_msp21          21
 #define bfd_mach_msp22          22
+#define bfd_mach_msp24          24
+#define bfd_mach_msp241         241
+#define bfd_mach_msp26          26
 #define bfd_mach_msp31          31
 #define bfd_mach_msp32          32
 #define bfd_mach_msp33          33
@@ -599,4 +602,3 @@
 
 This routine is provided for those cases where a bfd * is not
 available
-
diff -ur binutils-2.18.orig/bfd/elf32-msp430.c binutils-2.18/bfd/elf32-msp430.c
--- binutils-2.18.orig/bfd/elf32-msp430.c       2008-05-25 16:57:13.468750000 
+0300
+++ binutils-2.18/bfd/elf32-msp430.c    2008-05-25 17:07:00.515625000 +0300
@@ -576,6 +576,18 @@
       val = E_MSP430_MACH_MSP430x22;
       break;
 
+    case bfd_mach_msp24:
+      val = E_MSP430_MACH_MSP430x24;
+      break;
+
+    case bfd_mach_msp241:
+      val = E_MSP430_MACH_MSP430x241;
+      break;
+
+    case bfd_mach_msp26:
+      val = E_MSP430_MACH_MSP430x26;
+      break;
+
     case bfd_mach_msp31:
       val = E_MSP430_MACH_MSP430x31;
       break;
@@ -669,6 +681,18 @@
          e_set = bfd_mach_msp22;
          break;
 
+       case E_MSP430_MACH_MSP430x24:
+         e_set = bfd_mach_msp24;
+         break;
+
+       case E_MSP430_MACH_MSP430x241:
+         e_set = bfd_mach_msp241;
+         break;
+
+       case E_MSP430_MACH_MSP430x26:
+         e_set = bfd_mach_msp26;
+         break;
+
        case E_MSP430_MACH_MSP430x31:
          e_set = bfd_mach_msp31;
          break;
diff -ur binutils-2.18.orig/gas/config/tc-msp430.c 
binutils-2.18/gas/config/tc-msp430.c
--- binutils-2.18.orig/gas/config/tc-msp430.c   2008-05-25 16:57:13.484375000 
+0300
+++ binutils-2.18/gas/config/tc-msp430.c        2008-05-25 17:07:00.531250000 
+0300
@@ -250,6 +250,9 @@
 #define MSP430_ISA_20   20
 #define MSP430_ISA_21   21
 #define MSP430_ISA_22   22
+#define MSP430_ISA_24   24
+#define MSP430_ISA_241  241
+#define MSP430_ISA_26   26
 #define MSP430_ISA_31   31
 #define MSP430_ISA_32   32
 #define MSP430_ISA_33   33
@@ -317,6 +320,24 @@
   {"msp430x2234",  MSP430_ISA_22,  bfd_mach_msp22},
   {"msp430x2254",  MSP430_ISA_22,  bfd_mach_msp22},
   {"msp430x2274",  MSP430_ISA_22,  bfd_mach_msp22},
+
+  {"msp430x247",   MSP430_ISA_24,  bfd_mach_msp24},
+  {"msp430x2471",  MSP430_ISA_24,  bfd_mach_msp24},
+  {"msp430x248",   MSP430_ISA_24,  bfd_mach_msp24},
+  {"msp430x2481",  MSP430_ISA_24,  bfd_mach_msp24},
+  {"msp430x249",   MSP430_ISA_24,  bfd_mach_msp24},
+  {"msp430x2491",  MSP430_ISA_24,  bfd_mach_msp24},
+  {"msp430x2410",  MSP430_ISA_24,  bfd_mach_msp24},
+
+  {"msp430x2416",  MSP430_ISA_241, bfd_mach_msp241},
+  {"msp430x2417",  MSP430_ISA_241, bfd_mach_msp241},
+  {"msp430x2418",  MSP430_ISA_241, bfd_mach_msp241},
+  {"msp430x2419",  MSP430_ISA_241, bfd_mach_msp241},
+  
+  {"msp430x2616",  MSP430_ISA_26,  bfd_mach_msp26},
+  {"msp430x2617",  MSP430_ISA_26,  bfd_mach_msp26},
+  {"msp430x2618",  MSP430_ISA_26,  bfd_mach_msp26},
+  {"msp430x2619",  MSP430_ISA_26,  bfd_mach_msp26},
   
   {"msp430x311",   MSP430_ISA_31,  bfd_mach_msp31},
   {"msp430x312",   MSP430_ISA_31,  bfd_mach_msp31},
@@ -844,6 +865,10 @@
             "                  msp430x2003  msp430x2013\n"
             "                  msp430x2101  msp430x2111  msp430x2121  
msp430x2131\n"
             "                  msp430x2234  msp430x2254  msp430x2274\n"
+            "                  msp430x247   msp430x248   msp430x249   
msp430x2410\n"
+            "                  msp430x2471  msp430x2481  msp430x2491\n"
+            "                  msp430x2416  msp430x2417  msp430x2418  
msp430x2419\n"
+            "                  msp430x2616  msp430x2617  msp430x2618  
msp430x2619\n"
             "                  msp430x311   msp430x312   msp430x313   
msp430x314  msp430x315\n"
             "                  msp430x323   msp430x325\n" 
             "                  msp430x336   msp430x337\n"
diff -ur binutils-2.18.orig/include/elf/msp430.h 
binutils-2.18/include/elf/msp430.h
--- binutils-2.18.orig/include/elf/msp430.h     2008-05-25 16:57:13.484375000 
+0300
+++ binutils-2.18/include/elf/msp430.h  2008-05-25 17:07:00.531250000 +0300
@@ -36,6 +36,9 @@
 #define E_MSP430_MACH_MSP430x20   20
 #define E_MSP430_MACH_MSP430x21   21
 #define E_MSP430_MACH_MSP430x22   22
+#define E_MSP430_MACH_MSP430x24   24
+#define E_MSP430_MACH_MSP430x241  241
+#define E_MSP430_MACH_MSP430x26   26
 #define E_MSP430_MACH_MSP430x31   31
 #define E_MSP430_MACH_MSP430x32   32
 #define E_MSP430_MACH_MSP430x33   33
diff -ur binutils-2.18.orig/ld/Makefile.am binutils-2.18/ld/Makefile.am
--- binutils-2.18.orig/ld/Makefile.am   2008-05-25 16:57:13.531250000 +0300
+++ binutils-2.18/ld/Makefile.am        2008-05-25 17:07:00.578125000 +0300
@@ -321,6 +321,21 @@
        emsp430x2234.o \
        emsp430x2254.o \
        emsp430x2274.o \
+       emsp430x247.o \
+       emsp430x248.o \
+       emsp430x249.o \
+       emsp430x2410.o \
+       emsp430x2471.o \
+       emsp430x2481.o \
+       emsp430x2491.o \
+       emsp430x2416.o \
+       emsp430x2417.o \
+       emsp430x2418.o \
+       emsp430x2419.o \
+       emsp430x2616.o \
+       emsp430x2617.o \
+       emsp430x2618.o \
+       emsp430x2619.o \
        emsp430x311.o \
        emsp430x312.o \
        emsp430x313.o \
@@ -1433,6 +1448,66 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x2274 "$(tdir_msp430x2274)" msp430all
+emsp430x247.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x247 "$(tdir_msp430x247)" msp430all
+emsp430x248.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x248 "$(tdir_msp430x248)" msp430all
+emsp430x249.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x249 "$(tdir_msp430x249)" msp430all
+emsp430x2410.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2410 "$(tdir_msp430x2410)" msp430all
+emsp430x2471.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2471 "$(tdir_msp430x2471)" msp430all
+emsp430x2481.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2481 "$(tdir_msp430x2481)" msp430all
+emsp430x2491.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2491 "$(tdir_msp430x2491)" msp430all
+emsp430x2416.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2416 "$(tdir_msp430x2416)" msp430all
+emsp430x2417.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2417 "$(tdir_msp430x2417)" msp430all
+emsp430x2418.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2418 "$(tdir_msp430x2418)" msp430all
+emsp430x2419.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2419 "$(tdir_msp430x2419)" msp430all
+emsp430x2616.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2616 "$(tdir_msp430x2616)" msp430all
+emsp430x2617.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2617 "$(tdir_msp430x2617)" msp430all
+emsp430x2618.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2618 "$(tdir_msp430x2618)" msp430all
+emsp430x2619.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2619 "$(tdir_msp430x2619)" msp430all
 emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
   ${GEN_DEPENDS}
diff -ur binutils-2.18.orig/ld/Makefile.in binutils-2.18/ld/Makefile.in
--- binutils-2.18.orig/ld/Makefile.in   2008-05-25 16:57:13.546875000 +0300
+++ binutils-2.18/ld/Makefile.in        2008-05-25 17:07:00.593750000 +0300
@@ -568,6 +568,21 @@
        emsp430x2234.o \
        emsp430x2254.o \
        emsp430x2274.o \
+       emsp430x247.o \
+       emsp430x248.o \
+       emsp430x249.o \
+       emsp430x2410.o \
+       emsp430x2471.o \
+       emsp430x2481.o \
+       emsp430x2491.o \
+       emsp430x2416.o \
+       emsp430x2417.o \
+       emsp430x2418.o \
+       emsp430x2419.o \
+       emsp430x2616.o \
+       emsp430x2617.o \
+       emsp430x2618.o \
+       emsp430x2619.o \
        emsp430x311.o \
        emsp430x312.o \
        emsp430x313.o \
@@ -2259,6 +2274,66 @@
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
   ${GEN_DEPENDS}
        ${GENSCRIPTS} msp430x2274 "$(tdir_msp430x2274)" msp430all
+emsp430x247.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x247 "$(tdir_msp430x247)" msp430all
+emsp430x248.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x248 "$(tdir_msp430x248)" msp430all
+emsp430x249.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x249 "$(tdir_msp430x249)" msp430all
+emsp430x2410.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2410 "$(tdir_msp430x2410)" msp430all
+emsp430x2471.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2471 "$(tdir_msp430x2471)" msp430all
+emsp430x2481.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2481 "$(tdir_msp430x2481)" msp430all
+emsp430x2491.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2491 "$(tdir_msp430x2491)" msp430all
+emsp430x2416.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2416 "$(tdir_msp430x2416)" msp430all
+emsp430x2417.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2417 "$(tdir_msp430x2417)" msp430all
+emsp430x2418.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2418 "$(tdir_msp430x2418)" msp430all
+emsp430x2419.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2419 "$(tdir_msp430x2419)" msp430all
+emsp430x2616.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2616 "$(tdir_msp430x2616)" msp430all
+emsp430x2617.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2617 "$(tdir_msp430x2617)" msp430all
+emsp430x2618.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2618 "$(tdir_msp430x2618)" msp430all
+emsp430x2619.c: $(srcdir)/emulparams/msp430all.sh \
+  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
+  ${GEN_DEPENDS}
+       ${GENSCRIPTS} msp430x2619 "$(tdir_msp430x2619)" msp430all
 emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
   ${GEN_DEPENDS}
diff -ur binutils-2.18.orig/ld/configure.tgt binutils-2.18/ld/configure.tgt
--- binutils-2.18.orig/ld/configure.tgt 2008-05-25 16:57:13.500000000 +0300
+++ binutils-2.18/ld/configure.tgt      2008-05-25 17:07:00.562500000 +0300
@@ -407,7 +407,7 @@
 mt-*elf)                targ_emul=elf32mt
                        ;;
 msp430-*-*)             targ_emul=msp430x110
-                        targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 
msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 
msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 
msp430x149 msp430x1471 msp430x1481 msp430x1491 msp430x155 msp430x156 msp430x157 
msp430x167 msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 
msp430x2001 msp430x2011 msp430x2002 msp430x2012 msp430x2003 msp430x2013 
msp430x2101 msp430x2111 msp430x2121 msp430x2131 msp430x2234 msp430x2254 
msp430x2274 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 
msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430x415 msp430x417 
msp430x423 msp430x425 msp430x427 msp430x4250 msp430x4260 msp430x4270 
msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 
msp430xG437 msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447 
msp430x448 msp430x449 msp430xG4616 msp430xG4617 msp430xG4618 msp430xG4619"
+                        targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 
msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 
msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 
msp430x149 msp430x1471 msp430x1481 msp430x1491 msp430x155 msp430x156 msp430x157 
msp430x167 msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 
msp430x2001 msp430x2011 msp430x2002 msp430x2012 msp430x2003 msp430x2013 
msp430x2101 msp430x2111 msp430x2121 msp430x2131 msp430x2234 msp430x2254 
msp430x2274 msp430x247 msp430x248 msp430x249 msp430x2410 msp430x2471 
msp430x2481 msp430x2491 msp430x2416 msp430x2417 msp430x2418 msp430x2419 
msp430x2616 msp430x2617 msp430x2618 msp430x2619 msp430x311 msp430x312 
msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 
msp430x412 msp430x413 msp430x415 msp430x417 msp430x423 msp430x425 msp430x427 
msp430x4250 msp430x4260 msp430x4270 msp430xE423 msp430xE425 msp430xE427 
msp430xW423 msp430xW425 msp430xW427 msp430xG437 msp430xG438 msp430xG439 
msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449 msp430xG4616 
msp430xG4617 msp430xG4618 msp430xG4619"
                        ;;
 ns32k-pc532-mach* | ns32k-pc532-ux*)  targ_emul=pc532macha ;;
 ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd
diff -ur binutils-2.18.orig/ld/emulparams/msp430all.sh 
binutils-2.18/ld/emulparams/msp430all.sh
--- binutils-2.18.orig/ld/emulparams/msp430all.sh       2008-05-25 
16:57:13.515625000 +0300
+++ binutils-2.18/ld/emulparams/msp430all.sh    2008-05-25 17:07:00.562500000 
+0300
@@ -485,6 +485,171 @@
 STACK=0x600
 fi
 
+if [ "${MSP430_NAME}" = "msp430x247" ] ; then
+ARCH=msp:24
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x248" ] ; then
+ARCH=msp:24
+ROM_START=0x4000
+ROM_SIZE=0xbfe0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x249" ] ; then
+ARCH=msp:24
+ROM_START=0x1100
+ROM_SIZE=0xeee0
+RAM_START=0x0200
+RAM_SIZE=2048
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0xa00
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2410" ] ; then
+ARCH=msp:24
+ROM_START=0x2100
+ROM_SIZE=0xdee0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2471" ] ; then
+ARCH=msp:24
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2481" ] ; then
+ARCH=msp:24
+ROM_START=0x4000
+ROM_SIZE=0xbfe0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2491" ] ; then
+ARCH=msp:24
+ROM_START=0x1100
+ROM_SIZE=0xeee0
+RAM_START=0x0200
+RAM_SIZE=2048
+VECTORS_START=0xffe0
+VECTORS_SIZE=32
+STACK=0xa00
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2416" ] ; then
+ARCH=msp:241
+ROM_START=0x2100
+ROM_SIZE=0xdec0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2417" ] ; then
+ARCH=msp:241
+ROM_START=0x3100
+ROM_SIZE=0xcec0
+RAM_START=0x1100
+RAM_SIZE=8192
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x3100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2418" ] ; then
+ARCH=msp:241
+ROM_START=0x3100
+ROM_SIZE=0xcec0
+RAM_START=0x1100
+RAM_SIZE=8192
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x3100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2419" ] ; then
+ARCH=msp:241
+ROM_START=0x2100
+ROM_SIZE=0xdec0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2616" ] ; then
+ARCH=msp:26
+ROM_START=0x2100
+ROM_SIZE=0xdec0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x2100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2617" ] ; then
+ARCH=msp:26
+ROM_START=0x3100
+ROM_SIZE=0xcec0
+RAM_START=0x1100
+RAM_SIZE=8192
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x3100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2618" ] ; then
+ARCH=msp:26
+ROM_START=0x3100
+ROM_SIZE=0xcec0
+RAM_START=0x1100
+RAM_SIZE=8192
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x3100
+fi
+
+if [ "${MSP430_NAME}" = "msp430x2619" ] ; then
+ARCH=msp:26
+ROM_START=0x2100
+ROM_SIZE=0xdec0
+RAM_START=0x1100
+RAM_SIZE=4096
+VECTORS_START=0xffc0
+VECTORS_SIZE=64
+STACK=0x2100
+fi
+
 if [ "${MSP430_NAME}" = "msp430x311" ] ; then
 ARCH=msp:31
 SCRIPT_NAME=elf32msp430_3
diff -ur binutils-2.18.orig/opcodes/msp430-dis.c 
binutils-2.18/opcodes/msp430-dis.c
--- binutils-2.18.orig/opcodes/msp430-dis.c     2008-05-25 16:57:13.578125000 
+0300
+++ binutils-2.18/opcodes/msp430-dis.c  2008-05-25 17:07:00.609375000 +0300
@@ -681,7 +681,9 @@
 
   if (((int) addr & 0xffff) >= 0xffe0
       ||
-      (info->mach == 46  &&  ((int) addr & 0xffff) >= 0xffc0))
+      ((info->mach == 241 || info->mach == 26 || info->mach == 46)
+       &&
+       ((int) addr & 0xffff) >= 0xffc0))
     {
       (*prin) (stream, "interrupt service routine at 0x%04x", 0xffff & insn);
       return 2;
diff -ru binutils-2.17.orig/ld/scripttempl/elf32msp430.sc 
binutils-2.17/ld/scripttempl/elf32msp430.sc
--- binutils-2.17.orig/ld/scripttempl/elf32msp430.sc    2008-05-23 
02:00:49.049465400 +0300
+++ binutils-2.17/ld/scripttempl/elf32msp430.sc 2008-05-24 18:13:23.343750000 
+0300
@@ -14,7 +14,7 @@
     ${RELOCATING+ PROVIDE (__heap_bottom = .) ; }
     ${RELOCATING+ PROVIDE (__heap_top = ${HEAP_START} + ${HEAP_LENGTH}) ; }
   } ${RELOCATING+ > heap}"
-HEAP_MEMORY_MSP430="heap(rwx)          : ORIGIN = $HEAP_START, LENGTH = 
$HEAP_LENGTH"
+HEAP_MEMORY_MSP430="heap(rwx)         : ORIGIN = $HEAP_START,    LENGTH = 
$HEAP_LENGTH"
 fi
 
 
@@ -24,12 +24,12 @@
 
 MEMORY
 {
-  text   (rx)          : ORIGIN = $ROM_START,    LENGTH = $ROM_SIZE
-  data   (rwx)         : ORIGIN = $RAM_START,    LENGTH = $RAM_SIZE
-  vectors (rw)         : ORIGIN = $VECTORS_START LENGTH = $VECTORS_SIZE
-  bootloader(rx)       : ORIGIN = 0x0c00,            LENGTH = 1K
-  infomem(rx)          : ORIGIN = 0x1000,            LENGTH = 256
-  infomemnobits(rx)    : ORIGIN = 0x1000,        LENGTH = 256
+  text   (rx)       : ORIGIN = $ROM_START,    LENGTH = $ROM_SIZE
+  data   (rwx)      : ORIGIN = $RAM_START,    LENGTH = $RAM_SIZE
+  vectors (rw)      : ORIGIN = $VECTORS_START,    LENGTH = $VECTORS_SIZE
+  bootloader(rx)    : ORIGIN = 0x0c00,     LENGTH = 1K
+  infomem(rx)       : ORIGIN = 0x1000,     LENGTH = 256
+  infomemnobits(rx) : ORIGIN = 0x1000,     LENGTH = 256
   ${HEAP_MEMORY_MSP430}
 }
 
@@ -100,22 +100,35 @@
   {
     ${RELOCATING+. = ALIGN(2);}
     *(.init)
-    *(.init0)  /* Start here after reset.  */
-    *(.init1)
-    *(.init2)  /* Copy data loop  */
-    *(.init3)
-    *(.init4)  /* Clear bss  */
-    *(.init5)
-    *(.init6)  /* C++ constructors.  */
-    *(.init7)
-    *(.init8)
-    *(.init9)  /* Call main().  */
+    KEEP(*(.init))
+    *(.init0)  /* Start here after reset.               */
+    KEEP(*(.init0))
+    *(.init1)  /* User definable.                       */
+    KEEP(*(.init1))
+    *(.init2)  /* Initialize stack.                     */
+    KEEP(*(.init2))
+    *(.init3)  /* Initialize hardware, user definable.  */
+    KEEP(*(.init3))
+    *(.init4)  /* Copy data to .data, clear bss.        */
+    KEEP(*(.init4))
+    *(.init5)  /* User definable.                       */
+    KEEP(*(.init5))
+    *(.init6)  /* C++ constructors.                     */
+    KEEP(*(.init6))
+    *(.init7)  /* User definable.                       */
+    KEEP(*(.init7))
+    *(.init8)  /* User definable.                       */
+    KEEP(*(.init8))
+    *(.init9)  /* Call main().                          */
+    KEEP(*(.init9))
 
     ${CONSTRUCTING+ __ctors_start = . ; }
     ${CONSTRUCTING+ *(.ctors) }
+    ${CONSTRUCTING+ KEEP(*(.ctors)) }
     ${CONSTRUCTING+ __ctors_end = . ; }
     ${CONSTRUCTING+ __dtors_start = . ; }
     ${CONSTRUCTING+ *(.dtors) }
+    ${CONSTRUCTING+ KEEP(*(.dtors)) }
     ${CONSTRUCTING+ __dtors_end = . ; }
 
     ${RELOCATING+. = ALIGN(2);}
@@ -124,31 +137,45 @@
     *(.text.*)
 
     ${RELOCATING+. = ALIGN(2);}
-    *(.fini9)  /*   */
-    *(.fini8)
-    *(.fini7)
-    *(.fini6)  /* C++ destructors.  */
-    *(.fini5)
-    *(.fini4)
-    *(.fini3)
-    *(.fini2)
-    *(.fini1)
+    *(.fini9)  /* Jumps here after main(). User definable.  */
+    KEEP(*(.fini9))
+    *(.fini8)  /* User definable.                           */
+    KEEP(*(.fini8))
+    *(.fini7)  /* User definable.                           */
+    KEEP(*(.fini7))
+    *(.fini6)  /* C++ destructors.                          */
+    KEEP(*(.fini6))
+    *(.fini5)  /* User definable.                           */
+    KEEP(*(.fini5))
+    *(.fini4)  /* User definable.                           */
+    KEEP(*(.fini4))
+    *(.fini3)  /* User definable.                           */
+    KEEP(*(.fini3))
+    *(.fini2)  /* User definable.                           */
+    KEEP(*(.fini2))
+    *(.fini1)  /* User definable.                           */
+    KEEP(*(.fini1))
     *(.fini0)  /* Infinite loop after program termination.  */
+    KEEP(*(.fini0))
     *(.fini)
+    KEEP(*(.fini))
 
     _etext = .;
   } ${RELOCATING+ > text}
 
-  .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
+  .data ${RELOCATING-0} :
   {  
     ${RELOCATING+ PROVIDE (__data_start = .) ; }
     ${RELOCATING+. = ALIGN(2);}
     *(.data)
+    *(.data.*)
     ${RELOCATING+. = ALIGN(2);}
     *(.gnu.linkonce.d*)
     ${RELOCATING+. = ALIGN(2);}
     ${RELOCATING+ _edata = . ; }
-  } ${RELOCATING+ > data}
+  } ${RELOCATING+ > data AT > text}
+   ${RELOCATING+ PROVIDE (__data_load_start = LOADADDR(.data) ); }
+   ${RELOCATING+ PROVIDE (__data_size = SIZEOF(.data) ); }
   
   /* Bootloader.  */
   .bootloader ${RELOCATING-0} :
@@ -175,19 +202,22 @@
     *(.infomemnobits.*)
   } ${RELOCATING+ > infomemnobits}
 
-  .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
+  .bss ${RELOCATING-0} :
   {
     ${RELOCATING+ PROVIDE (__bss_start = .) ; }
     *(.bss)
+    *(.bss.*)
     *(COMMON)
     ${RELOCATING+ PROVIDE (__bss_end = .) ; }
     ${RELOCATING+ _end = . ;  }
   } ${RELOCATING+ > data}
+   ${RELOCATING+ PROVIDE (__bss_size = SIZEOF(.bss) ); }
 
-  .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
+  .noinit ${RELOCATING-0} :
   {
     ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
     *(.noinit)
+    *(.noinit.*)
     *(COMMON)
     ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
     ${RELOCATING+ _end = . ;  }
@@ -197,6 +227,7 @@
   {
     ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
     *(.vectors*)
+    KEEP(*(.vectors*))
     ${RELOCATING+ _vectors_end = . ; }
   } ${RELOCATING+ > vectors}
 
diff -ru binutils-2.17.orig/ld/scripttempl/elf32msp430_3.sc 
binutils-2.17/ld/scripttempl/elf32msp430_3.sc
--- binutils-2.17.orig/ld/scripttempl/elf32msp430_3.sc  2008-05-23 
02:00:49.033840400 +0300
+++ binutils-2.17/ld/scripttempl/elf32msp430_3.sc       2008-05-24 
17:50:27.953125000 +0300
@@ -6,7 +6,7 @@
 {
   text   (rx)   : ORIGIN = $ROM_START,    LENGTH = $ROM_SIZE
   data   (rwx)  : ORIGIN = $RAM_START,           LENGTH = $RAM_SIZE
-  vectors (rw)  : ORIGIN = $VECTORS_START LENGTH = $VECTORS_SIZE
+  vectors (rw)  : ORIGIN = $VECTORS_START,    LENGTH = $VECTORS_SIZE
 }
 
 SECTIONS
@@ -76,22 +76,35 @@
   {
     ${RELOCATING+. = ALIGN(2);}
     *(.init)
-    *(.init0)  /* Start here after reset.  */
-    *(.init1)
-    *(.init2)
-    *(.init3)
-    *(.init4)
-    *(.init5)
-    *(.init6)  /* C++ constructors.  */
-    *(.init7)
-    *(.init8)
-    *(.init9)  /* Call main().  */
+    KEEP(*(.init))
+    *(.init0)  /* Start here after reset.               */
+    KEEP(*(.init0))
+    *(.init1)  /* User definable.                       */
+    KEEP(*(.init1))
+    *(.init2)  /* Initialize stack.                     */
+    KEEP(*(.init2))
+    *(.init3)  /* Initialize hardware, user definable.  */
+    KEEP(*(.init3))
+    *(.init4)  /* Copy data to .data, clear bss.        */
+    KEEP(*(.init4))
+    *(.init5)  /* User definable.                       */
+    KEEP(*(.init5))
+    *(.init6)  /* C++ constructors.                     */
+    KEEP(*(.init6))
+    *(.init7)  /* User definable.                       */
+    KEEP(*(.init7))
+    *(.init8)  /* User definable.                       */
+    KEEP(*(.init8))
+    *(.init9)  /* Call main().                          */
+    KEEP(*(.init9))
 
     ${CONSTRUCTING+ __ctors_start = . ; }
     ${CONSTRUCTING+ *(.ctors) }
+    ${CONSTRUCTING+ KEEP(*(.ctors)) }
     ${CONSTRUCTING+ __ctors_end = . ; }
     ${CONSTRUCTING+ __dtors_start = . ; }
     ${CONSTRUCTING+ *(.dtors) }
+    ${CONSTRUCTING+ KEEP(*(.dtors)) }
     ${CONSTRUCTING+ __dtors_end = . ; }
 
     ${RELOCATING+. = ALIGN(2);}
@@ -100,43 +113,60 @@
     *(.text.*)
 
     ${RELOCATING+. = ALIGN(2);}
-    *(.fini9)
-    *(.fini8)
-    *(.fini7)
-    *(.fini6)  /* C++ destructors.  */
-    *(.fini5)
-    *(.fini4)
-    *(.fini3)
-    *(.fini2)
-    *(.fini1)
+    *(.fini9)  /* Jumps here after main(). User definable.  */
+    KEEP(*(.fini9))
+    *(.fini8)  /* User definable.                           */
+    KEEP(*(.fini8))
+    *(.fini7)  /* User definable.                           */
+    KEEP(*(.fini7))
+    *(.fini6)  /* C++ destructors.                          */
+    KEEP(*(.fini6))
+    *(.fini5)  /* User definable.                           */
+    KEEP(*(.fini5))
+    *(.fini4)  /* User definable.                           */
+    KEEP(*(.fini4))
+    *(.fini3)  /* User definable.                           */
+    KEEP(*(.fini3))
+    *(.fini2)  /* User definable.                           */
+    KEEP(*(.fini2))
+    *(.fini1)  /* User definable.                           */
+    KEEP(*(.fini1))
     *(.fini0)  /* Infinite loop after program termination.  */
+    KEEP(*(.fini0))
     *(.fini)
+    KEEP(*(.fini))
 
     ${RELOCATING+ _etext = . ; }
   } ${RELOCATING+ > text}
 
-  .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
+  .data ${RELOCATING-0} :
   {  
     ${RELOCATING+ PROVIDE (__data_start = .) ; }
     *(.data)
+    *(.data.*)
     *(.gnu.linkonce.d*)
     ${RELOCATING+. = ALIGN(2);}
     ${RELOCATING+ _edata = . ; }
-  } ${RELOCATING+ > data}
+  } ${RELOCATING+ > data AT > text}
+   ${RELOCATING+ PROVIDE (__data_load_start = LOADADDR(.data) ); }
+   ${RELOCATING+ PROVIDE (__data_size = SIZEOF(.data) ); }
   
-  .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
+  .bss ${RELOCATING-0} :
   {
     ${RELOCATING+ PROVIDE (__bss_start = .) ; }
     *(.bss)
+    *(.bss.*)
     *(COMMON)
     ${RELOCATING+ PROVIDE (__bss_end = .) ; }
     ${RELOCATING+ _end = . ;  }
   } ${RELOCATING+ > data}
+   ${RELOCATING+ PROVIDE (__bss_size = SIZEOF(.bss) ); }
 
-  .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
+  .noinit ${RELOCATING-0} :
   {
     ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
     *(.noinit)
+    *(.noinit.*)
     *(COMMON)
     ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
     ${RELOCATING+ _end = . ;  }
@@ -146,6 +176,7 @@
   {
     ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
     *(.vectors*)
+    KEEP(*(.vectors*))
     ${RELOCATING+ _vectors_end = . ; }
   } ${RELOCATING+ > vectors}
 
diff -ur gcc-3.2.3.orig/gcc/config/msp430/msp430.h 
gcc-3.2.3/gcc/config/msp430/msp430.h
--- gcc-3.2.3.orig/gcc/config/msp430/msp430.h   2008-05-25 22:42:50.187500000 
+0300
+++ gcc-3.2.3/gcc/config/msp430/msp430.h        2008-05-25 23:29:13.921875000 
+0300
@@ -2088,6 +2088,9 @@
    This macro controls how the assembler definitions of uninitialized
    common global variables are output.  */
 
+#define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED)                        
\
+  asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))
+
 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED)  \
 do {                                                   \
      char *p = NAME;                                   \
diff -ur gcc-3.2.3.orig/gcc/config/msp430/libgcc.S 
gcc-3.2.3/gcc/config/msp430/libgcc.S
--- gcc-3.2.3.orig/gcc/config/msp430/libgcc.S   2008-05-26 02:00:07.000000000 
+0300
+++ gcc-3.2.3/gcc/config/msp430/libgcc.S        2008-05-26 02:56:52.250000000 
+0300
@@ -547,65 +547,216 @@
 
 /******* CRT support functions *********/
 
+#if defined(L_reset_vector__)
+/*****************************************************************
+ * Program starts here.
+ *   overwriting this label in the user program
+ *   causes removing all strtup code except __do_global_ctors
+ *****************************************************************/
+       .section .init0, "ax", @progbits
+
+       .global _reset_vector__
+       .weak   _reset_vector__
+
+       .func   _reset_vector__
+
+_reset_vector__:
+
+    /* link following functions if library _reset_vector__ used */
+
+;    actualy stack initialized in main() prologue, so don't link __init_stack
+;      .global __init_stack
+
+       .global __low_level_init
+       .global __jump_to_main
+
+       .endfunc
+#endif  /* defined(L_reset_vector__) */
+    
+#if defined(L__init_stack)
+/*****************************************************************
+ * Set stack pointer
+ * can be overwriten
+ *****************************************************************/
+       .section .init2, "ax", @progbits
+
+       .global __init_stack
+       .weak   __init_stack
+       .extern __stack
+
+       .func   __init_stack
+
+set_stack_pointer:
+       mov     #__stack, r1
+
+       .endfunc
+#endif
+
+#if defined(L__low_level_init)
+/*****************************************************************
+ * Initialize peripherial, particularly disable watchdog
+ * can be overwriten
+ *****************************************************************/
+       .section .init3, "ax", @progbits
+
+       .global __low_level_init
+       .weak   __low_level_init
+
+       .func   __low_level_init
+
+__low_level_init:
+       mov     #0x5a80, &0x120
+
+       .endfunc
+#endif
+
+#if defined(L_copy_data)
+/*****************************************************************
+ * Initialize data: copy data 
+ * from __data_load_start ( = _etext) to __data_start
+ * can be overwriten
+ *****************************************************************/
+       .section .init4, "ax", @progbits
+
+       .global __do_copy_data
+       .weak   __do_copy_data
+       .extern __data_load_start
+       .extern __data_start
+       .extern __data_size
+
+       .func   __do_copy_data
+
+__do_copy_data:
+       mov     #__data_size, r15
+.L__copy_data_loop:
+       decd    r15
+       mov.w   __data_load_start(r15), __data_start(r15)    ; data section is 
word-aligned, so word transfer is acceptable
+       jne     .L__copy_data_loop
+
+       .endfunc
+#endif /* defined(L__do_copy_data) */
+    
+#if defined(L_clear_bss)
+/*****************************************************************
+ * Initialize data: clear .bss
+ * can be overwriten
+ *****************************************************************/
+       .section .init4, "ax", @progbits
+
+       .global __do_clear_bss
+       .weak   __do_clear_bss
+       .extern __bss_start
+       .extern __bss_size
+
+       .func   __do_clear_bss
+
+__do_clear_bss:
+       mov     #__bss_size, r15
+.L__clear_bss_loop:
+       dec     r15
+       clr.b   __bss_start(r15)
+       jne     .L__clear_bss_loop
+
+       .endfunc
+#endif  /* defined(L_clear_bss) */
+
+#if defined(L_ctors)
+/*****************************************************************
+ * Call C++ global and static objects constructors
+ * can be overwriten
+ *****************************************************************/
+       .section .init6, "ax", @progbits
+       .global __do_global_ctors
+       .weak   __do_global_ctors
+       .extern __ctors_start
+       .extern __ctors_end
+    
+       .func   __do_global_ctors
+
+       mov     #__stack, r1    ; can be removed, if stack initialization in 
.init2 uncommented
+
+__do_global_ctors:
+       mov     #__ctors_start, r11
+       mov     #__ctors_end,   r10
+.L__ctors_loop:
+       call    @r11+   ; call constructor
+       cmp     r10, r11
+       jne     .L__ctors_loop
+
+       .endfunc
+#endif
+    
+#if defined(L__jump_to_main)
+/*****************************************************************
+ * jump to main.
+ * can be overwriten
+ *****************************************************************/
+       .section .init9, "ax", @progbits
+
+       .global __jump_to_main
+       .weak   __jump_to_main
+       .extern _main
+
+       .func   __jump_to_main
+
+__jump_to_main:
+       br      #main
+       .endfunc
+#endif
+
 #if defined(L__stop_progExec__)
+/*****************************************************************
+ * return from main.
+ * can be overwriten
+ *****************************************************************/
+       .section .fini9, "ax", @progbits
        .global __stop_progExec__
        .weak   __stop_progExec__
+
        .func  __stop_progExec__
+
 __stop_progExec__:
-       bis     r15, r2
-       jmp     __stop_progExec__
+
        .endfunc
-#endif /* #if defined(L__stop_progExec__) */
+#endif
 
-#if defined(L_reset_vector__)
+#if defined(L_dtors)
 /*****************************************************************
- * Initialize data: copy data from _etext to __data_start
- * Can be overwritten.
+ * Call C++ global and static objects destructors
+ * can be overwriten
  *****************************************************************/
-       .extern _etext
-       .extern __data_start
-       .extern _edata
-       .extern __bss_start
-       .extern __bss_end
-       .extern __stack
+       .section .fini6,"ax",@progbits
+       .global __do_global_dtors
+       .weak   __do_global_dtors
+       .extern __dtors_start
+       .extern __dtors_end
+    
+       .func   _dtors
+
+__do_global_dtors:
+       mov     #__dtors_start, r11
+       mov     #__dtors_end, r10
+.L__dtors_loop:
+       call    @r11+
+       cmp     r10, r11
+       jne     .L__dtors_loop
 
-       .section .init, "ax", @progbits
-
-       .global _reset_vector__
-
-.func _reset_vector__
-_reset_vector__:
-       mov     #23168, &288
-       mov     #_etext,        r15     ; load r15 with end of .text segment
-       mov     #__data_start,  r14     ; load ram start
-       mov     #_edata,        r13     ; end of data segment
-       cmp     r14,        r13
-       jeq     .Lend_of_data_loop 
-;;     inc     r13
-.Lcopy_data_loop:  
-       /* copy data from @r15 to @r14 */
-       mov.b   @r15+,  @r14        ; move one byte
-       inc     r14
-       cmp     r13,    r14          ; check if end of data reached
-       jlo     .Lcopy_data_loop
-.Lend_of_data_loop:
-
-       mov     #__bss_start,   r15
-       mov     #__bss_end,     r13
-       cmp     r15,        r13
-       jeq     .Lend_of_bss_loop  
-;;     inc     r13
-.Lzero_bss:
-       clr.b   @r15
-       inc     r15 
-       cmp     r13,    r15     ; check if r15 < r13
-       jlo     .Lzero_bss
-.Lend_of_bss_loop:
-       br      #main   ;       jump to main procedure
-.endfunc
+       .endfunc
 #endif
 
+#if defined(L__stop_progExec__)
+/*****************************************************************
+ * endless loop
+ * can be overwriten
+ *****************************************************************/
+       .section .fini0, "ax", @progbits
+
+       .func   _endless_loop__
+1:
+       jmp  1b
 
+       .endfunc
+#endif
 
 /********* PROLOGE / EPILOGUE aux routines ******************/
 #if defined (L__prologue_saver)
diff -ur gcc-3.2.3.orig/gcc/config/msp430/msp430.h 
gcc-3.2.3/gcc/config/msp430/msp430.h
--- gcc-3.2.3.orig/gcc/config/msp430/msp430.h   2008-05-26 02:00:07.000000000 
+0300
+++ gcc-3.2.3/gcc/config/msp430/msp430.h        2008-05-26 03:02:36.031250000 
+0300
@@ -1749,7 +1749,7 @@
    operation that should precede instructions and read-only data.
    Normally `"\t.text"' is right.  */
 
-#define DATA_SECTION_ASM_OP "\t.data"
+#define DATA_SECTION_ASM_OP "\t.global\t__do_copy_data\n\t.data"
 /* A C expression whose value is a string containing the assembler
    operation to identify the following data as writable initialized
    data.  Normally `"\t.data"' is right.  */
@@ -1790,6 +1790,19 @@
 }
 
 
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+   There are no shared libraries on this target, and these sections are
+   placed in the read-only program memory, so they are not writable.  */
+
+#undef CTORS_SECTION_ASM_OP
+#define CTORS_SECTION_ASM_OP "\t.global\t__do_global_ctors\n\t.section 
.ctors,\"a\",@progbits"
+
+#undef DTORS_SECTION_ASM_OP
+#define DTORS_SECTION_ASM_OP "\t.global\t__do_global_dtors\n\t.section 
.dtors,\"a\",@progbits"
+
+#define TARGET_ASM_CONSTRUCTOR default_ctor_section_asm_out_constructor
+
+#define TARGET_ASM_DESTRUCTOR default_dtor_section_asm_out_destructor
 
 /* `EXTRA_SECTION_FUNCTIONS'
    One or more functions to be defined in `varasm.c'.  These
@@ -2099,7 +2112,7 @@
    This macro controls how the assembler definitions of uninitialized
    static variables are output.  */
 
-#define BSS_SECTION_ASM_OP     "\t.section\t.bss"
+#define BSS_SECTION_ASM_OP     "\t.global\t__do_clear_bss\n\t.section\t.bss"
 /* If defined, a C expression whose value is a string containing the
    assembler operation to identify the following data as
    uninitialized global data.  If not defined, and neither
diff -ur gcc-3.2.3.orig/gcc/config/msp430/t-msp430 
gcc-3.2.3/gcc/config/msp430/t-msp430
--- gcc-3.2.3.orig/gcc/config/msp430/t-msp430   2008-05-26 02:00:07.000000000 
+0300
+++ gcc-3.2.3/gcc/config/msp430/t-msp430        2008-05-26 02:53:02.843750000 
+0300
@@ -31,8 +31,14 @@
        _umoddi3 \
        _divdi3 \
        _moddi3 \
-       _muldi3 
-       
+       _muldi3 \
+       __low_level_init \
+       __init_stack \
+       _copy_data \
+       _clear_bss \
+       _ctors \
+       __jump_to_main \
+       _dtors
        
        
 

Reply via email to