aboutsummaryrefslogtreecommitdiff
path: root/gas/config/rx-parse.y
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-03-16 11:33:55 +0000
committerNick Clifton <nickc@redhat.com>2016-03-16 11:33:55 +0000
commit5f2b6bc955535ebfc280a04c22c937cfedb83916 (patch)
tree1e3ab4d035b80a0ea3f91f113d4bf7ce070e00e2 /gas/config/rx-parse.y
parent9bff188f0da2859bd5efa8d0def8c0f93d0be410 (diff)
downloadgdb-5f2b6bc955535ebfc280a04c22c937cfedb83916.zip
gdb-5f2b6bc955535ebfc280a04c22c937cfedb83916.tar.gz
gdb-5f2b6bc955535ebfc280a04c22c937cfedb83916.tar.bz2
Fix checking bignum values that are being inserted into byte sized containers.
* read.c (emit_expr_with_reloc): Add code check a bignum with nbytes == 1. * config/rx/rx-parse.y (rx_intop): Accept bignum values for sizes other than 32-bits. * testsuite/gas/elf/bignum.s: New test source file. * testsuite/gas/elf/bignum.d: New test driver file. * testsuite/gas/elf/elf.exp: Run the new test.
Diffstat (limited to 'gas/config/rx-parse.y')
-rw-r--r--gas/config/rx-parse.y11
1 files changed, 8 insertions, 3 deletions
diff --git a/gas/config/rx-parse.y b/gas/config/rx-parse.y
index 3bd37d0..c0e3217 100644
--- a/gas/config/rx-parse.y
+++ b/gas/config/rx-parse.y
@@ -1494,9 +1494,14 @@ rx_intop (expressionS exp, int nbits, int opbits)
long v;
long mask, msb;
- if (exp.X_op == O_big && nbits == 32)
- return 1;
- if (exp.X_op != O_constant)
+ if (exp.X_op == O_big)
+ {
+ if (nbits == 32)
+ return 1;
+ if (exp.X_add_number == -1)
+ return 0;
+ }
+ else if (exp.X_op != O_constant)
return 0;
v = exp.X_add_number;