diff options
author | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-01-15 13:17:27 +0000 |
---|---|---|
committer | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-01-15 13:23:06 +0000 |
commit | 131cb553d6d10412b20cf49bb0e3a5e736a90a36 (patch) | |
tree | 3965e30e6016b4b61a6bb11cb7be81bbd57a99ab /ld | |
parent | c24d0e8d4850d4913a1630a53e272c930849406d (diff) | |
download | gdb-131cb553d6d10412b20cf49bb0e3a5e736a90a36.zip gdb-131cb553d6d10412b20cf49bb0e3a5e736a90a36.tar.gz gdb-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 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-msp430-elf/msp430-elf.exp | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-msp430-elf/reloc-lo-430x.s | 22 |
3 files changed, 29 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index c68d920..7e83e2b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +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. + 2020-01-15 Alan Modra <amodra@gmail.com> * testsuite/ld-powerpc/ambiguousv1b.d: Adjust expected output. diff --git a/ld/testsuite/ld-msp430-elf/msp430-elf.exp b/ld/testsuite/ld-msp430-elf/msp430-elf.exp index c9d4bee..777b358 100644 --- a/ld/testsuite/ld-msp430-elf/msp430-elf.exp +++ b/ld/testsuite/ld-msp430-elf/msp430-elf.exp @@ -174,6 +174,8 @@ run_ld_link_tests $msp430eithershuffletests run_ld_link_tests $msp430warntests run_dump_test valid-map +run_ld_link_tests {{ "Check no reloc overflow with #lo and data in the upper region" + "-m msp430X" "" "" {reloc-lo-430x.s} {} "reloc-lo-430x"}} # Don't run data region tests if a data region is specified if {[string match "*-mdata-region*" [board_info [target_info name] multilib_flags]]} { diff --git a/ld/testsuite/ld-msp430-elf/reloc-lo-430x.s b/ld/testsuite/ld-msp430-elf/reloc-lo-430x.s new file mode 100644 index 0000000..8709e79 --- /dev/null +++ b/ld/testsuite/ld-msp430-elf/reloc-lo-430x.s @@ -0,0 +1,22 @@ +.text + .balign 2 + .global foo + .type foo, @function +foo: + MOV.W #lo (P), R8 + RETA + .size foo, .-foo + + .balign 2 + .global main + .type main, @function +main: + CALLA #foo +.L4: + BRA #.L4 + .size main, .-main + .section .bss,"aw",@nobits + .balign 2 + .global P +P: + .zero 4 |