Fix the execution of the MSP430 simulator testsuite.
authorNick Clifton <nickc@redhat.com>
Tue, 5 Jan 2016 16:43:58 +0000 (16:43 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 5 Jan 2016 16:43:58 +0000 (16:43 +0000)
ld * emulparams/msp430elf.sh (RAM_START): Move to 0x500 - above the
MSP430 hardware multiply address range.
* scripttempl/elf32msp430.sc (__romdatastart): Define.
(__romdatacopysize): Define.
* scripttempl/elf32msp430_3.sc: Likewise.

tests * testutils.inc (__pass): Use the LMA addresses of the _passmsg
symbol.
(__fail): Likewise.

ld/ChangeLog
ld/emulparams/msp430elf.sh
ld/scripttempl/elf32msp430.sc
ld/scripttempl/elf32msp430_3.sc
sim/testsuite/sim/msp430/ChangeLog
sim/testsuite/sim/msp430/testutils.inc

index 3aa46ed88e02f82334ea8b1ea9d5da803998ad0b..528cc6ed39ab002b1ce4ae505a02ed9a14312d2c 100644 (file)
@@ -1,3 +1,11 @@
+2016-01-05  Nick Clifton  <nickc@redhat.com>
+
+       * emulparams/msp430elf.sh (RAM_START): Move to 0x500 - above the
+       MSP430 hardware multiply address range.
+       * scripttempl/elf32msp430.sc (__romdatastart): Define.
+       (__romdatacopysize): Define.
+       * scripttempl/elf32msp430_3.sc: Likewise.
+
 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
 
        * emultempl/mipself.em (PARSE_AND_LIST_PROLOGUE): Convert
index a76e9ee30a5a080829800a27c21c5fed5b7633d1..e9d02375d32afb703be3e92adaabfb97b53737a7 100644 (file)
@@ -13,6 +13,6 @@ EMBEDDED=yes
 ARCH=msp:14
 ROM_START=0x8000
 ROM_SIZE=0x7fe0
-RAM_START=0x0200
+RAM_START=0x0500
 RAM_SIZE=1K
 STACK=0x600
index 78c7c12188ffffb660b266d4a57abd538826d78e..50b7ddb4bb250c26bed142315f8769f632365893 100644 (file)
@@ -269,6 +269,9 @@ SECTIONS
     ${RELOCATING+ _edata = . ; }
   } ${RELOCATING+ > data ${RELOCATING+AT> text}}
 
+  __romdatastart = LOADADDR(.data);
+  __romdatacopysize = SIZEOF(.data);
+  
   .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
   {
     ${RELOCATING+. = ALIGN(2);}
index 7a1308139b432d7140f2c88d45e9a5fcc2df1638..7ad04e10329a9d22d428d9322daed9cbb8a706e2 100644 (file)
@@ -147,6 +147,9 @@ SECTIONS
     ${RELOCATING+ _edata = . ; }
   } ${RELOCATING+ > data ${RELOCATING+AT> text}}
   
+  __romdatastart = LOADADDR(.data);
+  __romdatacopysize = SIZEOF(.data);
+  
   .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
   {
     ${RELOCATING+. = ALIGN(2);}
index d26efadac67a5f7967cc74b4e164bbf31bff2faf..458ee218734acf9ecc2a550a02d1b928062e2cfc 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-05  Nick Clifton  <nickc@redhat.com>
+
+       * testutils.inc (__pass): Use the LMA addresses of the _passmsg
+       symbol.
+       (__fail): Likewise.
+
 2014-03-10  Mike Frysinger  <vapier@gentoo.org>
 
        * add.s, allinsn.exp, testutils.inc: New files.
index 6c540b1042a4c069f7c5aa0170c11c808eca33d0..1ddef23f7f7d3a92a0d7488ca72c40fc736dee06 100644 (file)
@@ -9,13 +9,43 @@
        .global __pass
        .type __pass, function
 __pass:
-       write 1, _passmsg, 5
+       # Note - we cannot just invoke:
+       #
+       #  write 1, _passmsg, 5
+       #
+       # here because _passmsg contains the run-time (VMA) address of
+       # the pass string (probably 0x500) not the load-time (LMA)
+       # address (probably 0x804c).  Normally using the VMA address
+       # would be the correct thing to do - *if* there was some start
+       # up code which copied data from LMA to VMA.  But we have no
+       # start up code, so the data still resides at the LMA
+       # address.  Hence we use __romdatastart instead.
+       #
+       # Note - we are cheating because the address that we pass to
+       # "write" should actually be:
+       #
+       #    __romdatastart + (_passmsg - __datastart)
+       #
+       # but the assembler cannot cope with this expression.  So we
+       # cheat and use the fact that we know that _passmsg is the
+       # first string in the .data section and so (_passmsg -
+       # __datastart) evaluates to zero.
+
+       write 1, __romdatastart, 5
        exit 0
 
        .global __fail
        .type __fail, function
 __fail:
-       write 1, _failmsg, 5
+       # Note - see above.
+       #
+       #   write 1, _failmsg, 5
+       #
+       # This time we use the fact that _passmsg is aligned to a
+       # 16 byte boundary to work out that (_failmsg - __datastart)
+       # evaluates to 0x10.
+
+       write 1, __romdatastart + 0x10, 5
        exit 1
 
        .data
This page took 0.026741 seconds and 4 git commands to generate.