From d413a6233ac3bc0afe6ff5261df1421854334a6d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 4 Jun 2020 11:15:06 -0700 Subject: [PATCH] gas: Fix ip2k-elf and xstormy16-elf build Fix ip2k-elf and xstormy16-elf build due to commit e9bffec9afc45cf7c49308f0b4b8cc6bf68f58f2 Author: Jose E. Marchesi Date: Thu Jun 4 16:15:53 2020 +0200 opcodes: discriminate endianness and insn-endianness in CGEN ports * config/tc-ip2k. (ip2k_apply_fix): Pass endianness to cgen_get_insn_value. * config/tc-xstormy16.c (xstormy16_md_apply_fix): Pass endianness to cgen_get_insn_value and cgen_put_insn_value. --- gas/ChangeLog | 7 +++++++ gas/config/tc-ip2k.c | 3 ++- gas/config/tc-xstormy16.c | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 1c072e9c402..19cefba5e62 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2020-06-04 H.J. Lu + + * config/tc-ip2k. (ip2k_apply_fix): Pass endianness to + cgen_get_insn_value. + * config/tc-xstormy16.c (xstormy16_md_apply_fix): Pass + endianness to cgen_get_insn_value and cgen_put_insn_value. + 2020-06-04 Jose E. Marchesi * config/tc-bpf.c (md_apply_fix): Simplify and avoid using diff --git a/gas/config/tc-ip2k.c b/gas/config/tc-ip2k.c index 75cd61b01de..665cdc06360 100644 --- a/gas/config/tc-ip2k.c +++ b/gas/config/tc-ip2k.c @@ -385,7 +385,8 @@ ip2k_apply_fix (fixS *fixP, valueT *valueP, segT seg) CGEN_CPU_DESC cd = gas_cgen_cpu_desc; CGEN_INSN_INT insn_value = cgen_get_insn_value (cd, (unsigned char *) where, - CGEN_INSN_BITSIZE (fixP->fx_cgen.insn)); + CGEN_INSN_BITSIZE (fixP->fx_cgen.insn), + gas_cgen_cpu_desc->insn_endian); /* Preserve (DP) or (SP) specification. */ *valueP += (insn_value & 0x180); } diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c index c2bab0d9657..6bb5f2a3f0c 100644 --- a/gas/config/tc-xstormy16.c +++ b/gas/config/tc-xstormy16.c @@ -502,13 +502,15 @@ xstormy16_md_apply_fix (fixS * fixP, { CGEN_INSN_INT insn_value = cgen_get_insn_value (cd, (unsigned char *) where, - CGEN_INSN_BITSIZE (insn)); + CGEN_INSN_BITSIZE (insn), + gas_cgen_cpu_desc->insn_endian); /* ??? 0 is passed for `pc'. */ errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, &insn_value, (bfd_vma) 0); cgen_put_insn_value (cd, (unsigned char *) where, - CGEN_INSN_BITSIZE (insn), insn_value); + CGEN_INSN_BITSIZE (insn), insn_value, + gas_cgen_cpu_desc->insn_endian); } #else /* ??? 0 is passed for `pc'. */ -- 2.30.2