CVS: packaging/patches binutils-2.18-430X.patch, 1.4, 1.4.2.1

"Sergey A. Borshch" <[email protected]> Mon, 26 Jan 2009 15:57:19 +0000
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/packaging/patches
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22606/packaging/patches

Modified Files:
      Tag: MSP430X
	binutils-2.18-430X.patch 
Log Message:
gcc: 
 - 430X code >64K support added.
 - 430X data allocation at >64K added.
 - 430X 20bit prologues/epilogues added
 - multilibs added.
binutils-2.18-430X.patch:
 - mova Rsrc,TONI generation fixed.
 - error generation on bad mova args address modes added
 - .farrodata* section added to 430X devices ld scripts
 - unnecessary sections declarations before KEEP removed
 - 2232/2234 RAM size fixed


Index: binutils-2.18-430X.patch
===================================================================
RCS file: /cvsroot/mspgcc/packaging/patches/binutils-2.18-430X.patch,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -w -d -r1.4 -r1.4.2.1
--- binutils-2.18-430X.patch	26 Jan 2009 08:36:52 -0000	1.4
+++ binutils-2.18-430X.patch	26 Jan 2009 15:57:17 -0000	1.4.2.1
@@ -876,7 +876,7 @@
      return NULL;
 diff -ru 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	Sun Aug 10 11:37:28 2008
-+++ binutils-2.18/gas/config/tc-msp430.c	Mon Dec  8 03:44:18 2008
++++ binutils-2.18/gas/config/tc-msp430.c	Fri Jan 23 02:02:34 2009
 @@ -23,7 +23,6 @@
  
  #include <limits.h>
@@ -918,7 +918,7 @@
    int    tlab;		/* Number of labels in short mode.  */
    int    op0;		/* Opcode for first word of short jump.  */
    int    op1;		/* Opcode for second word of short jump.  */
-@@ -240,35 +241,72 @@
+@@ -240,35 +241,66 @@
    int mach;
  };
  
@@ -1006,16 +1006,12 @@
 -static struct mcu_type_s mcu_types[] =
 +static struct mcu_type_s const mcu_types[] =
  {
-   {"msp1",         MSP430_ISA_11,  bfd_mach_msp11},
-   {"msp2",         MSP430_ISA_14,  bfd_mach_msp14},
-+  {"msp3",         MSP430_ISA_46,  bfd_mach_msp46},
-+  {"msp4",         MSP430_ISA_47,  bfd_mach_msp47},
-+  {"msp5",         MSP430_ISA_471, bfd_mach_msp471},
-+  {"msp6",         MSP430_ISA_54,  bfd_mach_msp54},
+-  {"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},
-@@ -312,15 +350,27 @@
+@@ -312,15 +344,27 @@
    {"msp430x2003",  MSP430_ISA_20,  bfd_mach_msp20},
    {"msp430x2013",  MSP430_ISA_20,  bfd_mach_msp20},
  
@@ -1047,7 +1043,7 @@
    {"msp430x247",   MSP430_ISA_24,  bfd_mach_msp24},
    {"msp430x2471",  MSP430_ISA_24,  bfd_mach_msp24},
    {"msp430x248",   MSP430_ISA_24,  bfd_mach_msp24},
-@@ -362,9 +412,17 @@
+@@ -362,9 +406,17 @@
    {"msp430x4260",  MSP430_ISA_42,  bfd_mach_msp42},
    {"msp430x4270",  MSP430_ISA_42,  bfd_mach_msp42},
  
@@ -1065,7 +1061,7 @@
  
    {"msp430xW423",  MSP430_ISA_42,  bfd_mach_msp42},
    {"msp430xW425",  MSP430_ISA_42,  bfd_mach_msp42},
-@@ -375,8 +433,11 @@
+@@ -375,8 +427,11 @@
    {"msp430xG439",  MSP430_ISA_43,  bfd_mach_msp43},
  
    {"msp430x435",   MSP430_ISA_43,  bfd_mach_msp43},
@@ -1077,7 +1073,7 @@
    {"msp430x447",   MSP430_ISA_44,  bfd_mach_msp44},
    {"msp430x448",   MSP430_ISA_44,  bfd_mach_msp44},
    {"msp430x449",   MSP430_ISA_44,  bfd_mach_msp44},
-@@ -386,14 +447,36 @@
+@@ -386,14 +441,36 @@
    {"msp430xG4618", MSP430_ISA_46,  bfd_mach_msp46},
    {"msp430xG4619", MSP430_ISA_46,  bfd_mach_msp46},
  
@@ -1108,15 +1104,16 @@
  
  
 -static struct mcu_type_s default_mcu =
+-    { "msp430x11", MSP430_ISA_11, bfd_mach_msp11 };
 +static struct mcu_type_s const default_mcu =
-     { "msp430x11", MSP430_ISA_11, bfd_mach_msp11 };
++    { "msp430x110", MSP430_ISA_11, bfd_mach_msp11 };
  
 -static struct mcu_type_s * msp430_mcu = & default_mcu;
 +static struct mcu_type_s const * msp430_mcu = & default_mcu;
  
  /* Profiling capability:
     It is a performance hit to use gcc's profiling approach for this tiny target.
-@@ -447,7 +530,7 @@
+@@ -447,7 +524,7 @@
  	push r8
        .profiler "cdp",fxx,0, .LFrameOffset_fxx	; check stack value at this point
  						; (this is a prologue end)
@@ -1125,7 +1122,7 @@
  	mov r15,r8
  	....
        .profiler cdE,fxx		; check stack
-@@ -502,11 +585,14 @@
+@@ -502,11 +579,14 @@
  static char *
  parse_exp (char * s, expressionS * op)
  {
@@ -1141,7 +1138,7 @@
  }
  
  
-@@ -560,7 +646,8 @@
+@@ -560,7 +640,8 @@
    *(to + size) = 0;
    del_spaces (to);
  
@@ -1151,7 +1148,7 @@
  
    return from;
  }
-@@ -605,7 +692,8 @@
+@@ -605,7 +686,8 @@
        return;
      }
  
@@ -1161,7 +1158,7 @@
  
    while (*flags)
      {
-@@ -718,7 +806,7 @@
+@@ -718,7 +800,7 @@
        /* Process like ".word xxx" directive.  */
        parse_exp (str, & exp);
        emit_expr (& exp, 2);
@@ -1170,7 +1167,7 @@
      }
  
    /* Fill the rest with zeros.  */
-@@ -822,11 +910,14 @@
+@@ -822,11 +904,14 @@
    return 0;
  }
  
@@ -1185,7 +1182,7 @@
    {NULL, NULL, 0}
  };
  
-@@ -864,7 +955,11 @@
+@@ -864,7 +949,11 @@
  	     "                  msp430x2002  msp430x2012\n"
  	     "                  msp430x2003  msp430x2013\n"
  	     "                  msp430x2101  msp430x2111  msp430x2121  msp430x2131\n"
@@ -1197,11 +1194,11 @@
  	     "                  msp430x247   msp430x248   msp430x249   msp430x2410\n"
  	     "                  msp430x2471  msp430x2481  msp430x2491\n"
  	     "                  msp430x2416  msp430x2417  msp430x2418  msp430x2419\n"
-@@ -876,11 +971,21 @@
+@@ -876,11 +965,21 @@
  	     "                  msp430x423   msp430x425   msp430427\n"
  	     "                  msp430x4250  msp430x4260  msp4304270\n"
  	     "                  msp430xE423  msp430xE425  msp430E427\n"
-+	     "                  msp430xE4232 msp430xE4242 msp430xE4252 msp430E4272n"
++	     "                  msp430xE4232 msp430xE4242 msp430xE4252 msp430E4272\n"
  	     "                  msp430xW423  msp430xW425  msp430W427\n"
 +	     "                  msp430xG4250 msp430xG4260 msp430G4270\n"
  	     "                  msp430xG437  msp430xG438  msp430G439\n"
@@ -1220,7 +1217,7 @@
    fprintf (stream,
  	   _("  -mQ - enable relaxation at assembly time. DANGEROUS!\n"
  	     "  -mP - enable polymorph instructions\n"));
-@@ -956,7 +1061,7 @@
+@@ -956,7 +1055,7 @@
  void
  md_begin (void)
  {
@@ -1229,7 +1226,7 @@
    msp430_hash = hash_new ();
  
    for (opcode = msp430_opcodes; opcode->name; opcode++)
-@@ -986,10 +1091,63 @@
+@@ -986,10 +1085,63 @@
    return 0;
  }
  
@@ -1294,7 +1291,7 @@
  {
    char *__tl = l;
  
-@@ -1069,80 +1227,11 @@
+@@ -1069,80 +1221,11 @@
  		op->exp.X_add_number = 0;	/* Nothing left.  */
  	      x = op->exp.X_add_number;
  	    }
@@ -1379,7 +1376,7 @@
  	}
        else if (op->exp.X_op == O_symbol)
  	{
-@@ -1150,12 +1239,10 @@
+@@ -1150,12 +1233,10 @@
  	}
        else if (op->exp.X_op == O_big)
  	{
@@ -1392,7 +1389,7 @@
  	    }
  	  else
  	    {
-@@ -1164,49 +1251,6 @@
+@@ -1164,49 +1245,6 @@
  		      l);
  	      return 1;
  	    }
@@ -1442,7 +1439,7 @@
  	}
        /* Redudant (yet) check.  */
        else if (op->exp.X_op == O_register)
-@@ -1233,7 +1277,7 @@
+@@ -1233,7 +1271,7 @@
  	{
  	  int x = op->exp.X_add_number;
  
@@ -1451,7 +1448,7 @@
  	    {
  	      as_bad (_("value out of range: %d"), x);
  	      return 1;
-@@ -1368,7 +1412,7 @@
+@@ -1368,7 +1406,7 @@
  	{
  	  int x = op->exp.X_add_number;
  
@@ -1460,7 +1457,7 @@
  	    {
  	      as_bad (_("value out of range: %d"), x);
  	      return 1;
-@@ -1444,10 +1488,10 @@
+@@ -1444,10 +1482,10 @@
  
  
  static int
@@ -1473,7 +1470,7 @@
  
    if (ret)
      return ret;
-@@ -1479,39 +1523,135 @@
+@@ -1479,39 +1517,135 @@
    return 0;
  }
  
@@ -1620,7 +1617,7 @@
    while (! ISSPACE (*line) && *line)
      line++;
  
-@@ -1529,22 +1669,22 @@
+@@ -1529,22 +1663,22 @@
  
    imm_op = 0;
  
@@ -1650,7 +1647,7 @@
  	  if (res)
  	    break;
  
-@@ -1569,14 +1709,15 @@
+@@ -1569,14 +1703,15 @@
  	    }
  	  break;
  
@@ -1669,7 +1666,7 @@
  
  	    if (res)
  	      break;	/* An error occurred.  All warnings were done before.  */
-@@ -1604,7 +1745,12 @@
+@@ -1604,7 +1739,12 @@
  
  	    if (op2.mode == OP_EXP)
  	      {
@@ -1683,7 +1680,7 @@
  		bfd_putl16 ((bfd_vma) ZEROS, frag + 2 + ((__is == 3) ? 2 : 0));
  
  		if (op2.reg)	/* Not PC relative.  */
-@@ -1616,16 +1762,21 @@
+@@ -1616,16 +1756,21 @@
  	      }
  	    break;
  	  }
@@ -1709,7 +1706,7 @@
  
  	  bin |= ((op1.reg << 8) | (op1.am << 4));
  	  __is = 1 + op1.ol;
-@@ -1650,11 +1801,12 @@
+@@ -1650,11 +1795,12 @@
  	}
        break;
  
@@ -1725,7 +1722,7 @@
  
        if (res)
  	break;			/* Error occurred.  All warnings were done before.  */
-@@ -1682,7 +1834,12 @@
+@@ -1682,7 +1828,12 @@
  
        if (op2.mode == OP_EXP)
  	{
@@ -1739,7 +1736,7 @@
  	  bfd_putl16 ((bfd_vma) ZEROS, frag + 2 + ((__is == 3) ? 2 : 0));
  
  	  if (op2.reg)		/* Not PC relative.  */
-@@ -1694,8 +1851,8 @@
+@@ -1694,8 +1845,8 @@
  	}
        break;
  
@@ -1750,7 +1747,7 @@
  	{
  	  /* reti instruction.  */
  	  frag = frag_more (2);
-@@ -1705,9 +1862,10 @@
+@@ -1705,9 +1856,10 @@
  	}
  
        line = extract_operand (line, l1, sizeof (l1));
@@ -1762,7 +1759,7 @@
  
        bin |= op1.reg | (op1.am << 4);
        __is = 1 + op1.ol;
-@@ -1729,7 +1887,7 @@
+@@ -1729,7 +1881,7 @@
  	}
        break;
  
@@ -1771,7 +1768,7 @@
        line = extract_operand (line, l1, sizeof (l1));
        /* l1 is a label.  */
        if (l1[0])
-@@ -1799,11 +1957,13 @@
+@@ -1799,11 +1951,13 @@
  	  else if (*l1 == '$')
  	    {
  	      as_bad (_("instruction requires label sans '$'"));
@@ -1785,7 +1782,7 @@
  	    }
  	  dwarf2_emit_insn (2 * __is);
  	  break;
-@@ -1815,7 +1975,7 @@
+@@ -1815,7 +1969,7 @@
  	}
        break;
  
@@ -1794,7 +1791,7 @@
        if (!msp430_enable_polys)
  	{
  	  as_bad(_("polymorphs are not enabled. Use -mP option to enable."));
-@@ -1836,7 +1996,7 @@
+@@ -1836,7 +1990,7 @@
  	  if (exp.X_op == O_symbol)
  	    {
  	      /* Relaxation required.  */
@@ -1803,7 +1800,7 @@
  
  	      /* The parameter to dwarf2_emit_insn is actually the offset to the start
  		 of the insn from the fix piece of instruction that was emitted.
-@@ -1857,7 +2017,7 @@
+@@ -1857,7 +2011,7 @@
        as_bad (_("instruction requires label"));
        break;
  
@@ -1812,7 +1809,7 @@
        if (!msp430_enable_polys)
  	{
  	  as_bad(_("polymorphs are not enabled. Use -mP option to enable."));
-@@ -1877,7 +2037,7 @@
+@@ -1877,7 +2031,7 @@
  	  if (exp.X_op == O_symbol)
  	    {
  	      /* Relaxation required.  */
@@ -1821,7 +1818,7 @@
  
  	      frag = frag_more (8);
  	      dwarf2_emit_insn (0);
-@@ -1896,18 +2056,679 @@
+@@ -1896,18 +2050,673 @@
        as_bad (_("instruction requires label"));
        break;
  
@@ -2122,15 +2119,6 @@
 +                  fix_new_exp (frag_now, where, 2,
 +                                &(op2.exp), FALSE, BFD_RELOC_MSP430X_D);
 +                }
-+              else if(op2.mode == OP_EXP && op2.am == 1 && op2.reg == 0)
-+                {
-+                  bin |= 0x0070 | op1.reg << 8;
-+                  bfd_putl16 ((bfd_vma) bin, frag);
-+                  dwarf2_emit_insn (__is * 2);
-+                  bfd_putl16 ((bfd_vma) ZEROS, frag + 2);
-+                  fix_new_exp (frag_now, where, 2,
-+                                &(op2.exp), TRUE, BFD_RELOC_MSP430X_PCREL_D);
-+                }
 +              else if(op2.mode == OP_EXP && op2.am == 1)
 +                {
 +                  // mova Rsrc, z16(Rdst)
@@ -2148,7 +2136,6 @@
 +                }
 +              else
 +		as_bad (_("destination operand address mode not allowed with mova instruction"));
-+                
 +            }
 +          else if (op2.mode == OP_REG && op2.am == 0)
 +            { // Rdst
@@ -2166,7 +2153,7 @@
 +                  bfd_putl16 ((bfd_vma) bin, frag);
 +                  dwarf2_emit_insn (__is * 2);
 +                }
-+              else if (op1.mode == OP_EXP && op1.am == 1 && op1.reg == 2)
++              else if (op1.mode == OP_EXP && op1.am == 1)
 +                {
 +                  if (op1.reg == 2)
 +                    {
@@ -2211,6 +2198,10 @@
 +              else
 +		as_bad (_("source operand address mode not allowed with mova instruction"));
 +            }
++          else
++            {
++              as_bad (_("bad combination of operands address modes for mova instruction"));
++            }
 +          break;
 +        }
 +      else   
@@ -2503,7 +2494,7 @@
    char cmd[32];
    unsigned int i = 0;
  
-@@ -1927,7 +2748,7 @@
+@@ -1927,7 +2736,7 @@
        return;
      }
  
@@ -2512,7 +2503,7 @@
  
    if (opcode == NULL)
      {
-@@ -1935,6 +2756,12 @@
+@@ -1935,6 +2744,12 @@
        return;
      }
  
@@ -2525,7 +2516,7 @@
    {
      char *__t = input_line_pointer;
  
-@@ -2069,6 +2896,26 @@
+@@ -2069,6 +2884,26 @@
  
        switch (fixp->fx_r_type)
  	{
@@ -2552,7 +2543,7 @@
  	case BFD_RELOC_MSP430_10_PCREL:
  	  if (value & 1)
  	    as_bad_where (fixp->fx_file, fixp->fx_line,
-@@ -2093,7 +2940,7 @@
+@@ -2093,7 +2928,7 @@
  			  _("odd address operand: %ld"), value);
  
  	  /* Nothing to be corrected here.  */
@@ -2561,7 +2552,7 @@
  	    as_bad_where (fixp->fx_file, fixp->fx_line,
  			  _("operand out of range: %ld"), value);
  
-@@ -2103,7 +2950,7 @@
+@@ -2103,7 +2938,7 @@
  
  	case BFD_RELOC_MSP430_16_PCREL_BYTE:
  	  /* Nothing to be corrected here.  */
@@ -2570,7 +2561,7 @@
  	    as_bad_where (fixp->fx_file, fixp->fx_line,
  			  _("operand out of range: %ld"), value);
  
-@@ -2120,6 +2967,76 @@
+@@ -2120,6 +2955,76 @@
  	case BFD_RELOC_MSP430_16_BYTE:
  	  value &= 0xffff;
  	  bfd_putl16 ((bfd_vma) value, where);
@@ -4900,8 +4891,8 @@
 +VECTORS_SIZE=$((0x10000 - VECTORS_START))
 diff -ru binutils-2.18.orig/ld/scripttempl/elf32msp430.sc binutils-2.18/ld/scripttempl/elf32msp430.sc
 --- binutils-2.18.orig/ld/scripttempl/elf32msp430.sc	Sun Aug 10 11:37:28 2008
-+++ binutils-2.18/ld/scripttempl/elf32msp430.sc	Sun Dec  7 21:50:56 2008
-@@ -17,6 +17,29 @@
++++ binutils-2.18/ld/scripttempl/elf32msp430.sc	Sat Jan 24 14:56:19 2009
+@@ -17,6 +17,34 @@
  HEAP_MEMORY_MSP430="heap(rwx)         : ORIGIN = $HEAP_START,    LENGTH = $HEAP_LENGTH"
  fi
  
@@ -4921,8 +4912,13 @@
 +    *(.fartext)
 +    ${RELOCATING+. = ALIGN(2);}
 +    *(.fartext.*)
-+
 +    _efartext = .;
++    ${RELOCATING+. = ALIGN(2);}
++    *(.farrodata)
++    ${RELOCATING+. = ALIGN(2);}
++    *(.farrodata.*)
++    _efarrodata = .;
++
 +  } ${RELOCATING+ > fartext}"
 +else
 +TEXT_REGION_MSP430="text   (rx)       : ORIGIN = $ROM_START,     LENGTH = $ROM_SIZE"
@@ -4931,7 +4927,7 @@
  
  cat <<EOF
  OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
-@@ -24,9 +47,9 @@
+@@ -24,9 +52,9 @@
  
  MEMORY
  {
@@ -4944,7 +4940,96 @@
    bootloader(rx)    : ORIGIN = 0x0c00,     LENGTH = 1K
    infomem(rx)       : ORIGIN = 0x1000,     LENGTH = 256
    infomemnobits(rx) : ORIGIN = 0x1000,     LENGTH = 256
-@@ -231,6 +254,7 @@
+@@ -99,35 +127,22 @@
+   .text :
+   {
+     ${RELOCATING+. = ALIGN(2);}
+-    *(.init)
+     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))
++    KEEP(*(.init0)) /* Start here after reset.               */
++    KEEP(*(.init1)) /* User definable.                       */
++    KEEP(*(.init2)) /* Initialize stack.                     */
++    KEEP(*(.init3)) /* Initialize hardware, user definable.  */
++    KEEP(*(.init4)) /* Copy data to .data, clear bss.        */
++    KEEP(*(.init5)) /* User definable.                       */
++    KEEP(*(.init6)) /* C++ constructors.                     */
++    KEEP(*(.init7)) /* User definable.                       */
++    KEEP(*(.init8)) /* User definable.                       */
++    KEEP(*(.init9)) /* Call main().                          */
+ 
+     ${CONSTRUCTING+ __ctors_start = . ; }
+-    ${CONSTRUCTING+ *(.ctors) }
+     ${CONSTRUCTING+ KEEP(*(.ctors)) }
+     ${CONSTRUCTING+ __ctors_end = . ; }
+     ${CONSTRUCTING+ __dtors_start = . ; }
+-    ${CONSTRUCTING+ *(.dtors) }
+     ${CONSTRUCTING+ KEEP(*(.dtors)) }
+     ${CONSTRUCTING+ __dtors_end = . ; }
+ 
+@@ -137,27 +152,16 @@
+     *(.text.*)
+ 
+     ${RELOCATING+. = ALIGN(2);}
+-    *(.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(*(.fini9)) /* Jumps here after main(). User definable.  */
++    KEEP(*(.fini8)) /* User definable.                           */
++    KEEP(*(.fini7)) /* User definable.                           */
++    KEEP(*(.fini6)) /* C++ destructors.                          */
++    KEEP(*(.fini5)) /* User definable.                           */
++    KEEP(*(.fini4)) /* User definable.                           */
++    KEEP(*(.fini3)) /* User definable.                           */
++    KEEP(*(.fini2)) /* User definable.                           */
++    KEEP(*(.fini1)) /* User definable.                           */
++    KEEP(*(.fini0)) /* Infinite loop after program termination.  */
+     KEEP(*(.fini))
+ 
+     _etext = .;
+@@ -226,11 +230,11 @@
+   .vectors ${RELOCATING-0}:
+   {
+     ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
+-    *(.vectors*)
+     KEEP(*(.vectors*))
      ${RELOCATING+ _vectors_end = . ; }
    } ${RELOCATING+ > vectors}
  
@@ -4952,7 +5037,7 @@
    ${HEAP_SECTION_MSP430}
  
    /* Stabs for profiling information*/
-@@ -269,6 +293,10 @@
+@@ -269,6 +273,10 @@
    .debug_str      0 : { *(.debug_str) }
    .debug_loc      0 : { *(.debug_loc) }
    .debug_macinfo  0 : { *(.debug_macinfo) }
@@ -4963,6 +5048,102 @@
  
    PROVIDE (__stack = ${STACK}) ;
    PROVIDE (__data_start_rom = _etext) ;
+diff -ru 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	Sun Aug 10 11:37:28 2008
++++ binutils-2.18/ld/scripttempl/elf32msp430_3.sc	Sat Jan 24 14:56:15 2009
+@@ -75,35 +75,23 @@
+   .text :
+   {
+     ${RELOCATING+. = ALIGN(2);}
+-    *(.init)
++
+     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))
++    KEEP(*(.init0)) /* Start here after reset.               */
++    KEEP(*(.init1)) /* User definable.                       */
++    KEEP(*(.init2)) /* Initialize stack.                     */
++    KEEP(*(.init3)) /* Initialize hardware, user definable.  */
++    KEEP(*(.init4)) /* Copy data to .data, clear bss.        */
++    KEEP(*(.init5)) /* User definable.                       */
++    KEEP(*(.init6)) /* C++ constructors.                     */
++    KEEP(*(.init7)) /* User definable.                       */
++    KEEP(*(.init8)) /* User definable.                       */
++    KEEP(*(.init9)) /* Call main().                          */
+ 
+     ${CONSTRUCTING+ __ctors_start = . ; }
+-    ${CONSTRUCTING+ *(.ctors) }
+     ${CONSTRUCTING+ KEEP(*(.ctors)) }
+     ${CONSTRUCTING+ __ctors_end = . ; }
+     ${CONSTRUCTING+ __dtors_start = . ; }
+-    ${CONSTRUCTING+ *(.dtors) }
+     ${CONSTRUCTING+ KEEP(*(.dtors)) }
+     ${CONSTRUCTING+ __dtors_end = . ; }
+ 
+@@ -113,27 +101,16 @@
+     *(.text.*)
+ 
+     ${RELOCATING+. = ALIGN(2);}
+-    *(.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(*(.fini9)) /* Jumps here after main(). User definable.  */
++    KEEP(*(.fini8)) /* User definable.                           */
++    KEEP(*(.fini7)) /* User definable.                           */
++    KEEP(*(.fini6)) /* C++ destructors.                          */
++    KEEP(*(.fini5)) /* User definable.                           */
++    KEEP(*(.fini4)) /* User definable.                           */
++    KEEP(*(.fini3)) /* User definable.                           */
++    KEEP(*(.fini2)) /* User definable.                           */
++    KEEP(*(.fini1)) /* User definable.                           */
++    KEEP(*(.fini0)) /* Infinite loop after program termination.  */
+     KEEP(*(.fini))
+ 
+     ${RELOCATING+ _etext = . ; }
+@@ -175,7 +152,6 @@
+   .vectors ${RELOCATING-0}:
+   {
+     ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
+-    *(.vectors*)
+     KEEP(*(.vectors*))
+     ${RELOCATING+ _vectors_end = . ; }
+   } ${RELOCATING+ > vectors}
 diff -ru binutils-2.18.orig/opcodes/msp430-dis.c binutils-2.18/opcodes/msp430-dis.c
 --- binutils-2.18.orig/opcodes/msp430-dis.c	Sun Aug 10 11:37:28 2008
 +++ binutils-2.18/opcodes/msp430-dis.c	Mon Dec  8 04:12:26 2008


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword