aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJozef Lawrynowicz <jozef.l@mittosystems.com>2020-01-15 13:17:27 +0000
committerJozef Lawrynowicz <jozef.l@mittosystems.com>2020-01-15 13:23:06 +0000
commit131cb553d6d10412b20cf49bb0e3a5e736a90a36 (patch)
tree3965e30e6016b4b61a6bb11cb7be81bbd57a99ab /include
parentc24d0e8d4850d4913a1630a53e272c930849406d (diff)
downloadbinutils-131cb553d6d10412b20cf49bb0e3a5e736a90a36.zip
binutils-131cb553d6d10412b20cf49bb0e3a5e736a90a36.tar.gz
binutils-131cb553d6d10412b20cf49bb0e3a5e736a90a36.tar.bz2
MSP430: Fix relocation overflow when using #lo(EXP) macro
gas/ChangeLog: 2020-01-15 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config/tc-msp430.c (CHECK_RELOC_MSP430): Always generate 430X relocations when the target is 430X, except when extracting part of an expression. (msp430_srcoperand): Adjust comment. Initialize the expp member of the msp430_operand_s struct as appropriate. (msp430_dstoperand): Likewise. * testsuite/gas/msp430/msp430.exp: Run new test. * testsuite/gas/msp430/reloc-lo-430x.d: New test. * testsuite/gas/msp430/reloc-lo-430x.s: New test. include/ChangeLog: 2020-01-15 Jozef Lawrynowicz <jozef.l@mittosystems.com> * opcode/msp430.h (enum msp430_expp_e): New. (struct msp430_operand_s): Add expp member to struct. ld/ChangeLog: 2020-01-15 Jozef Lawrynowicz <jozef.l@mittosystems.com> * testsuite/ld-msp430-elf/msp430-elf.exp: Run new test. * testsuite/ld-msp430-elf/reloc-lo-430x.s: New test.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog5
-rw-r--r--include/opcode/msp430.h15
2 files changed, 20 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 64a03f2..f6ad34d 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-15 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * opcode/msp430.h (enum msp430_expp_e): New.
+ (struct msp430_operand_s): Add expp member to struct.
+
2020-01-13 Claudiu Zissulescu <claziss@gmail.com>
* elf/arc-cpu.def: Update ARC cpu list.
diff --git a/include/opcode/msp430.h b/include/opcode/msp430.h
index aaf0990..96fe674 100644
--- a/include/opcode/msp430.h
+++ b/include/opcode/msp430.h
@@ -21,6 +21,18 @@
#ifndef __MSP430_H_
#define __MSP430_H_
+enum msp430_expp_e
+{
+ MSP_EXPP_ALL = 0, /* Use full the value of the expression - default. */
+ MSP_EXPP_LO, /* Extract least significant word from expression. */
+ MSP_EXPP_HI, /* Extract 2nd word from expression. */
+ MSP_EXPP_LLO, /* Extract least significant word from an
+ immediate value. */
+ MSP_EXPP_LHI, /* Extract 2nd word from an immediate value. */
+ MSP_EXPP_HLO, /* Extract 3rd word from an immediate value. */
+ MSP_EXPP_HHI, /* Extract 4th word from an immediate value. */
+};
+
struct msp430_operand_s
{
int ol; /* Operand length words. */
@@ -28,6 +40,9 @@ struct msp430_operand_s
int reg; /* Register. */
int mode; /* Operand mode. */
int vshift; /* Number of bytes to shift operand down. */
+ enum msp430_expp_e expp; /* For when the operand is a constant
+ expression, the part of the expression to
+ extract. */
#define OP_REG 0
#define OP_EXP 1
#ifndef DASM_SECTION