diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-06-19 07:12:48 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-06-20 07:24:25 +0200 |
commit | 160d1b3d74593bf42155da24569f54a6e7140f65 (patch) | |
tree | 07aa127b857a8233489f774a5d811b227865d691 /gas/config | |
parent | 4ef2c1b90ecca33c2948b7b009860767d64c6398 (diff) | |
download | gdb-160d1b3d74593bf42155da24569f54a6e7140f65.zip gdb-160d1b3d74593bf42155da24569f54a6e7140f65.tar.gz gdb-160d1b3d74593bf42155da24569f54a6e7140f65.tar.bz2 |
RISC-V: Accept constant operands in la and lla
opcodes/
PR gas/23305
* riscv-opc.c (riscv_opcodes): Use new format specifier 'B' for
la and lla.
gas/
PR gas/23305
* config/tc-riscv.c (riscv_ip): Add format specifier 'B' for
constants and symbols.
* testsuite/gas/riscv/lla32.d: New file.
* testsuite/gas/riscv/lla32.s: Likewise.
* testsuite/gas/riscv/lla64-fail.d: Likewise.
* testsuite/gas/riscv/lla64-fail.l: Likewise.
* testsuite/gas/riscv/lla64-fail.s: Likewise.
* testsuite/gas/riscv/lla64.d: Likewise.
* testsuite/gas/riscv/lla64.s: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-riscv.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index a0ea87a..bdec307 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -1935,6 +1935,17 @@ rvc_lui: s = expr_end; continue; + case 'B': + my_getExpression (imm_expr, s); + normalize_constant_expr (imm_expr); + /* The 'B' format specifier must be a symbol or a constant. */ + if (imm_expr->X_op != O_symbol && imm_expr->X_op != O_constant) + break; + if (imm_expr->X_op == O_symbol) + *imm_reloc = BFD_RELOC_32; + s = expr_end; + continue; + case 'j': /* Sign-extended immediate. */ *imm_reloc = BFD_RELOC_RISCV_LO12_I; p = percent_op_itype; |