diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2013-06-12 23:11:57 +0000 |
---|---|---|
committer | Sandra Loosemore <sandra@codesourcery.com> | 2013-06-12 23:11:57 +0000 |
commit | 5d5755a724d32a703e7ff0fe3d6a864706d91fa3 (patch) | |
tree | 94d85fd8defd69fdaa968ccd2c7ae47a1c9843fc | |
parent | 0c8fe7cfe2690fb49f8aab4ba23ff1080fd8f113 (diff) | |
download | gdb-5d5755a724d32a703e7ff0fe3d6a864706d91fa3.zip gdb-5d5755a724d32a703e7ff0fe3d6a864706d91fa3.tar.gz gdb-5d5755a724d32a703e7ff0fe3d6a864706d91fa3.tar.bz2 |
2013-06-12 Sandra Loosemore <sandra@codesourcery.com>
gas/
* config/tc-nios2.c (md_apply_fix): Mask constant
BFD_RELOC_NIOS2_HIADJ16 value to 16 bits.
gas/testsuite/
* gas/nios2/movia.s: Add additional test case with negative
constant value.
* gas/nios2/movia.d: Likewise.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-nios2.c | 3 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/nios2/movia.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/nios2/movia.s | 1 |
5 files changed, 16 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index f286916..8c5165b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2013-06-12 Sandra Loosemore <sandra@codesourcery.com> + + * config/tc-nios2.c (md_apply_fix): Mask constant + BFD_RELOC_NIOS2_HIADJ16 value to 16 bits. + 2013-06-10 Maciej W. Rozycki <macro@codesourcery.com> * config/tc-mips.c (append_insn): Don't do branch relaxation for diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c index 6c91fbe..659bbbc 100644 --- a/gas/config/tc-nios2.c +++ b/gas/config/tc-nios2.c @@ -1258,7 +1258,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) fixup = fixup & 0xFFFF; break; case BFD_RELOC_NIOS2_HIADJ16: - fixup = ((fixup >> 16) & 0xFFFF) + ((fixup >> 15) & 0x01); + fixup = ((((fixup >> 16) & 0xFFFF) + ((fixup >> 15) & 0x01)) + & 0xFFFF); break; default: { diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index b38bb43..f39a4e8 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2013-06-12 Sandra Loosemore <sandra@codesourcery.com> + * gas/nios2/movia.s: Add additional test case with negative + constant value. + * gas/nios2/movia.d: Likewise. + +2013-06-12 Sandra Loosemore <sandra@codesourcery.com> + * gas/nios2/tret.d: Correct eret encoding. 2013-06-10 Maciej W. Rozycki <macro@codesourcery.com> diff --git a/gas/testsuite/gas/nios2/movia.d b/gas/testsuite/gas/nios2/movia.d index 3903f18..9b04a9d 100644 --- a/gas/testsuite/gas/nios2/movia.d +++ b/gas/testsuite/gas/nios2/movia.d @@ -16,3 +16,5 @@ Disassembly of section .text: 10: R_NIOS2_HIADJ16 sym-0x7fffffff 0+0014 <[^>]*> 21000004 addi r4,r4,0 14: R_NIOS2_LO16 sym-0x7fffffff +0+0018 <[^>]*> 00800034 movhi r2,0 +0+001c <[^>]*> 10bffc04 addi r2,r2,-16 diff --git a/gas/testsuite/gas/nios2/movia.s b/gas/testsuite/gas/nios2/movia.s index fe1d56c..9bc921b 100644 --- a/gas/testsuite/gas/nios2/movia.s +++ b/gas/testsuite/gas/nios2/movia.s @@ -4,3 +4,4 @@ foo: movia r2, 0x80808080 movia r3, sym + 0x80000000 movia r4, sym - 0x7fffffff + movia r2, 0xfffffff0 |