summaryrefslogtreecommitdiff
path: root/sim/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-01-05 16:43:58 +0000
committerNick Clifton <nickc@redhat.com>2016-01-05 16:43:58 +0000
commit296ebfbb91bc9453134c467b4bfe8363582674f7 (patch)
tree94066be06cfe87444556d5218688903eacd97be8 /sim/testsuite
parentfa89c1268f5d4e9950f3faf8c027dbbeb6aac773 (diff)
Fix the execution of the MSP430 simulator testsuite.
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.
Diffstat (limited to 'sim/testsuite')
-rw-r--r--sim/testsuite/sim/msp430/ChangeLog6
-rw-r--r--sim/testsuite/sim/msp430/testutils.inc34
2 files changed, 38 insertions, 2 deletions
diff --git a/sim/testsuite/sim/msp430/ChangeLog b/sim/testsuite/sim/msp430/ChangeLog
index d26efadac6..458ee21873 100644
--- a/sim/testsuite/sim/msp430/ChangeLog
+++ b/sim/testsuite/sim/msp430/ChangeLog
@@ -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.
diff --git a/sim/testsuite/sim/msp430/testutils.inc b/sim/testsuite/sim/msp430/testutils.inc
index 6c540b1042..1ddef23f7f 100644
--- a/sim/testsuite/sim/msp430/testutils.inc
+++ b/sim/testsuite/sim/msp430/testutils.inc
@@ -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