From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1386) id E59FA3858D3C; Tue, 25 Apr 2023 09:19:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E59FA3858D3C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jan Beulich To: bfd-cvs@sourceware.org Subject: [binutils-gdb] RISC-V: don't recognize bogus relocations X-Act-Checkin: binutils-gdb X-Git-Author: Jan Beulich X-Git-Refname: refs/heads/master X-Git-Oldrev: a5e756e63e170cf69e06be98287528760833aad5 X-Git-Newrev: b33e94cfa4777b68719794ad1c1ef630e3dca3c2 Message-Id: <20230425091946.E59FA3858D3C@sourceware.org> Date: Tue, 25 Apr 2023 09:19:46 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2023 09:19:47 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db33e94cfa477= 7b68719794ad1c1ef630e3dca3c2 commit b33e94cfa4777b68719794ad1c1ef630e3dca3c2 Author: Jan Beulich Date: Tue Apr 25 11:17:19 2023 +0200 RISC-V: don't recognize bogus relocations =20 With my_getSmallExpression() consistently and silently failing on relocation operators not fitting an insn, it is no longer necessary to hand it percent_op_itype[] "just in case" (i.e. to avoid errors when a subsequent parsing attempt for another operand combination might succeed). This also eliminates the latent problem of percent_op_itype[] and percent_op_stype[] growing a non-identical set of recognized relocation operators. Diff: --- gas/config/tc-riscv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 6b7112bc7c7..c99bab9b1c4 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -2531,7 +2531,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expres= sionS *imm_expr, =20 imm_expr->X_op =3D O_absent; *imm_reloc =3D BFD_RELOC_UNUSED; - p =3D percent_op_itype; + p =3D percent_op_null; =20 for (oparg =3D insn->args;; ++oparg) { @@ -3247,7 +3247,6 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expres= sionS *imm_expr, p =3D percent_op_rtype; goto alu_op; case '0': /* AMO displacement, which must be zero. */ - p =3D percent_op_null; load_store: if (riscv_handle_implicit_zero_offset (imm_expr, asarg)) continue;