From 4fcaa1c95ad33b94b9be9234ab2e79e2e9aad9bb Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Wed, 2 Dec 2015 14:22:35 -0800 Subject: 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. --- binutils/gas/config/tc-riscv.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'binutils') 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; -- cgit v1.1