aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2015-12-02 14:22:35 -0800
committerPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2015-12-02 14:22:35 -0800
commit4fcaa1c95ad33b94b9be9234ab2e79e2e9aad9bb (patch)
tree95370c41098624d9d7cb10d49736ba2bad71ebc4 /binutils
parent1d8d8bc9ea83ea9cffd1493cba20d82967a15801 (diff)
downloadriscv-gnu-toolchain-4fcaa1c95ad33b94b9be9234ab2e79e2e9aad9bb.zip
riscv-gnu-toolchain-4fcaa1c95ad33b94b9be9234ab2e79e2e9aad9bb.tar.gz
riscv-gnu-toolchain-4fcaa1c95ad33b94b9be9234ab2e79e2e9aad9bb.tar.bz2
Correct the "{l,s}{b,h,w,d} REG, ADDR, REG" format
ADDR in this format is only meant to be a symbolic address, not a numeric address. Things are this way because of linker relaxation. Passing a numeric address would result in an internal assertion triggering, this patch just makes gas reject these instructions cleanly. This compiles glibc on a5 for me. This should fix bug #106.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/gas/config/tc-riscv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/binutils/gas/config/tc-riscv.c b/binutils/gas/config/tc-riscv.c
index 8fd329e..f391d4c 100644
--- a/binutils/gas/config/tc-riscv.c
+++ b/binutils/gas/config/tc-riscv.c
@@ -1607,6 +1607,9 @@ rvc_lui:
case 'A':
my_getExpression (imm_expr, s);
normalize_constant_expr (imm_expr);
+ /* The 'A' format specifier must be a symbol. */
+ if (imm_expr->X_op != O_symbol)
+ break;
*imm_reloc = BFD_RELOC_32;
s = expr_end;
continue;