Hello:
It all started with this message:
msp430-ld: cannot represent machine 'msp:200'
Looking into the mailing list archive, I've found an e-mail from Cyril
Holweck dated on 2006-11-14 which raises the question to the list, some
minutes later he brings up an solution which consists of applying a similar
patch to [1] to binutils. Even this is also affecting MSP430x22xx models, I
will focus on MSP430x2013 which is the one I'm testing with.
This patch modifies the microcontroller name in the bfd_arch_info_type
struct instanced as arch_info_struct. (bfd/cpu-msp430.c:44). I saw the
bfd_mach_msp20 mach value sensible(20) (bfd/bfd-in2.h:1959).
Also in the gcc code, msp430_mcu_types definition of the struct mcu_type_s
you can see (gcc/config/msp430/msp430.c:187)
{"msp430x2013", MSP430_ISA_20, 0},
Providing a value of 20 to this arch as well.
I wasn't sure wether the solution proposed by Cyril was a real solution
or was good enough. I didn't understand where the msp:200 identifier could
came provided the comments before.
After some more research I came across this definition on the file
ld/emulparams/msp430all.sh:
-----8<----------------------------------------
if [ "${MSP430_NAME}" = "msp430x2013" ] ; then
ARCH=msp:20
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
MAXPAGESIZE=1
EMBEDDED=yes
TEMPLATE_NAME=generic
ROM_START=0xF800
ROM_SIZE=0x07e0
RAM_START=0x0200
RAM_SIZE=128
STACK=0x280
fi
----->8----------------------------------------
and hence the problem. I've done an analysis of what's most commonly used
for different models [2]. The rule I get is that arch should be the 2
digits after the MSP430x, except for those starting with MSP430x1 and
having 3 digits after the one, where arch should be 110.
In order to be consistent with this rule I'm proposing the patch [3].
Would anyone have any comment about this subject? I would appreciate them.
Thanks and regards,
[1] cpu-msp430.c_name_fix.diff (attached)
[2] msp430-archlist (atatched)
[3] msp430all.sh_arch_fix.diff (attached)
--
Raúl Sánchez Siles
--- bfd/cpu-msp430.c.orig 2007-11-06 13:58:20.000000000 +0100
+++ bfd/cpu-msp430.c 2007-11-06 13:59:30.000000000 +0100
@@ -66,13 +66,13 @@
--- bfd.org/cpu-msp430.c 2007-11-06 13:58:20.000000000 +0100
/* msp430x20x. */
- N (16, bfd_mach_msp20, "msp:20", FALSE, & arch_info_struct[8]),
+ N (16, bfd_mach_msp20, "msp:200", FALSE, & arch_info_struct[8]),
/* msp430x21x. */
- N (16, bfd_mach_msp21, "msp:21", FALSE, & arch_info_struct[9]),
+ N (16, bfd_mach_msp21, "msp:210", FALSE, & arch_info_struct[9]),
/* msp430x22x. */
- N (16, bfd_mach_msp22, "msp:22", FALSE, & arch_info_struct[10]),
+ N (16, bfd_mach_msp22, "msp:220", FALSE, & arch_info_struct[10]),
/* msp430x31x. */
N (16, bfd_mach_msp31, "msp:31", FALSE, & arch_info_struct[11]),
--- ld/emulparams/msp430all.sh.orig 2007-11-06 16:46:07.000000000 +0100
+++ ld/emulparams/msp430all.sh 2007-11-06 16:58:58.000000000 +0100
@@ -516,7 +516,7 @@
--- ld.org/emulparams/msp430all.sh 2007-11-06 16:46:07.000000000 +0100
if [ "${MSP430_NAME}" = "msp430x2001" ] ; then
-ARCH=msp:200
+ARCH=msp:20
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
@@ -532,7 +532,7 @@
fi
if [ "${MSP430_NAME}" = "msp430x2011" ] ; then
-ARCH=msp:200
+ARCH=msp:20
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
@@ -549,7 +549,7 @@
fi
if [ "${MSP430_NAME}" = "msp430x2002" ] ; then
-ARCH=msp:200
+ARCH=msp:20
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
@@ -566,7 +566,7 @@
fi
if [ "${MSP430_NAME}" = "msp430x2012" ] ; then
-ARCH=msp:200
+ARCH=msp:20
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
@@ -583,7 +583,7 @@
fi
if [ "${MSP430_NAME}" = "msp430x2003" ] ; then
-ARCH=msp:200
+ARCH=msp:20
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
@@ -600,7 +600,7 @@
fi
if [ "${MSP430_NAME}" = "msp430x2013" ] ; then
-ARCH=msp:200
+ARCH=msp:20
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
@@ -685,7 +685,7 @@
fi
if [ "${MSP430_NAME}" = "msp430x2234" ] ; then
-ARCH=msp:220
+ARCH=msp:22
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
@@ -702,7 +702,7 @@
fi
if [ "${MSP430_NAME}" = "msp430x2254" ] ; then
-ARCH=msp:220
+ARCH=msp:22
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
@@ -719,7 +719,7 @@
fi
if [ "${MSP430_NAME}" = "msp430x2274" ] ; then
-ARCH=msp:220
+ARCH=msp:22
MACHINE=
SCRIPT_NAME=elf32msp430
OUTPUT_FORMAT="elf32-msp430"
if [ "${MSP430_NAME}" = "msp430x110" ] ; then
ARCH=msp:11
--
if [ "${MSP430_NAME}" = "msp430x1101" ] ; then
ARCH=msp:110
--
if [ "${MSP430_NAME}" = "msp430x1111" ] ; then
ARCH=msp:110
--
if [ "${MSP430_NAME}" = "msp430x112" ] ; then
ARCH=msp:11
--
if [ "${MSP430_NAME}" = "msp430x1121" ] ; then
ARCH=msp:110
--
if [ "${MSP430_NAME}" = "msp430x1122" ] ; then
ARCH=msp:110
--
if [ "${MSP430_NAME}" = "msp430x1132" ] ; then
ARCH=msp:110
--
if [ "${MSP430_NAME}" = "msp430x122" ] ; then
ARCH=msp:12
--
if [ "${MSP430_NAME}" = "msp430x1222" ] ; then
ARCH=msp:12
--
if [ "${MSP430_NAME}" = "msp430x123" ] ; then
ARCH=msp:12
--
if [ "${MSP430_NAME}" = "msp430x1232" ] ; then
ARCH=msp:12
--
if [ "${MSP430_NAME}" = "msp430x133" ] ; then
ARCH=msp:13
--
if [ "${MSP430_NAME}" = "msp430x1331" ] ; then
ARCH=msp:13
--
if [ "${MSP430_NAME}" = "msp430x135" ] ; then
ARCH=msp:13
--
if [ "${MSP430_NAME}" = "msp430x1351" ] ; then
ARCH=msp:13
--
if [ "${MSP430_NAME}" = "msp430x147" ] ; then
ARCH=msp:14
--
if [ "${MSP430_NAME}" = "msp430x148" ] ; then
ARCH=msp:14
--
if [ "${MSP430_NAME}" = "msp430x149" ] ; then
ARCH=msp:14
--
if [ "${MSP430_NAME}" = "msp430x1471" ] ; then
ARCH=msp:14
--
if [ "${MSP430_NAME}" = "msp430x1481" ] ; then
ARCH=msp:14
--
if [ "${MSP430_NAME}" = "msp430x1491" ] ; then
ARCH=msp:14
--
if [ "${MSP430_NAME}" = "msp430x155" ] ; then
ARCH=msp:15
--
if [ "${MSP430_NAME}" = "msp430x156" ] ; then
ARCH=msp:15
--
if [ "${MSP430_NAME}" = "msp430x157" ] ; then
ARCH=msp:15
--
if [ "${MSP430_NAME}" = "msp430x167" ] ; then
ARCH=msp:16
--
if [ "${MSP430_NAME}" = "msp430x168" ] ; then
ARCH=msp:16
--
if [ "${MSP430_NAME}" = "msp430x169" ] ; then
ARCH=msp:16
--
if [ "${MSP430_NAME}" = "msp430x1610" ] ; then
ARCH=msp:16
--
if [ "${MSP430_NAME}" = "msp430x1611" ] ; then
ARCH=msp:16
--
if [ "${MSP430_NAME}" = "msp430x1612" ] ; then
ARCH=msp:16
--
if [ "${MSP430_NAME}" = "msp430x2001" ] ; then
ARCH=msp:200
--
if [ "${MSP430_NAME}" = "msp430x2011" ] ; then
ARCH=msp:200
--
if [ "${MSP430_NAME}" = "msp430x2002" ] ; then
ARCH=msp:200
--
if [ "${MSP430_NAME}" = "msp430x2012" ] ; then
ARCH=msp:200
--
if [ "${MSP430_NAME}" = "msp430x2003" ] ; then
ARCH=msp:200
--
if [ "${MSP430_NAME}" = "msp430x2013" ] ; then
ARCH=msp:200
--
if [ "${MSP430_NAME}" = "msp430x2101" ] ; then
ARCH=msp:21
--
if [ "${MSP430_NAME}" = "msp430x2111" ] ; then
ARCH=msp:21
--
if [ "${MSP430_NAME}" = "msp430x2121" ] ; then
ARCH=msp:21
--
if [ "${MSP430_NAME}" = "msp430x2131" ] ; then
ARCH=msp:21
--
if [ "${MSP430_NAME}" = "msp430x2234" ] ; then
ARCH=msp:220
--
if [ "${MSP430_NAME}" = "msp430x2254" ] ; then
ARCH=msp:220
--
if [ "${MSP430_NAME}" = "msp430x2274" ] ; then
ARCH=msp:220
--
if [ "${MSP430_NAME}" = "msp430x311" ] ; then
ARCH=msp:31
--
if [ "${MSP430_NAME}" = "msp430x312" ] ; then
ARCH=msp:31
--
if [ "${MSP430_NAME}" = "msp430x313" ] ; then
ARCH=msp:31
--
if [ "${MSP430_NAME}" = "msp430x314" ] ; then
ARCH=msp:31
--
if [ "${MSP430_NAME}" = "msp430x315" ] ; then
ARCH=msp:31
--
if [ "${MSP430_NAME}" = "msp430x323" ] ; then
ARCH=msp:32
--
if [ "${MSP430_NAME}" = "msp430x325" ] ; then
ARCH=msp:32
--
if [ "${MSP430_NAME}" = "msp430x336" ] ; then
ARCH=msp:33
--
if [ "${MSP430_NAME}" = "msp430x337" ] ; then
ARCH=msp:33
--
if [ "${MSP430_NAME}" = "msp430x412" ] ; then
ARCH=msp:41
--
if [ "${MSP430_NAME}" = "msp430x413" ] ; then
ARCH=msp:41
--
if [ "${MSP430_NAME}" = "msp430x415" ] ; then
ARCH=msp:41
--
if [ "${MSP430_NAME}" = "msp430x417" ] ; then
ARCH=msp:41
--
if [ "${MSP430_NAME}" = "msp430x423" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430x425" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430x427" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430x4250" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430x4260" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430x4270" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430x435" ] ; then
ARCH=msp:43
--
if [ "${MSP430_NAME}" = "msp430x436" ] ; then
ARCH=msp:43
--
if [ "${MSP430_NAME}" = "msp430x437" ] ; then
ARCH=msp:43
--
if [ "${MSP430_NAME}" = "msp430x447" ] ; then
ARCH=msp:44
--
if [ "${MSP430_NAME}" = "msp430x448" ] ; then
ARCH=msp:44
--
if [ "${MSP430_NAME}" = "msp430x449" ] ; then
ARCH=msp:44
--
if [ "${MSP430_NAME}" = "msp430xG4616" ] ; then
ARCH=msp:46
--
if [ "${MSP430_NAME}" = "msp430xG4617" ] ; then
ARCH=msp:46
--
if [ "${MSP430_NAME}" = "msp430xG4618" ] ; then
ARCH=msp:46
--
if [ "${MSP430_NAME}" = "msp430xG4619" ] ; then
ARCH=msp:46
--
if [ "${MSP430_NAME}" = "msp430xE423" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430xE425" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430xE427" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430xG437" ] ; then
ARCH=msp:43
--
if [ "${MSP430_NAME}" = "msp430xG438" ] ; then
ARCH=msp:43
--
if [ "${MSP430_NAME}" = "msp430xG439" ] ; then
ARCH=msp:43
--
if [ "${MSP430_NAME}" = "msp430xW423" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430xW425" ] ; then
ARCH=msp:42
--
if [ "${MSP430_NAME}" = "msp430xW427" ] ; then
ARCH=msp:42