[PATCH] gas: Fix ip2k-elf and xstormy16-elf build

H.J. Lu hjl.tools@gmail.com
Thu Jun 4 18:16:34 GMT 2020


Fix ip2k-elf and xstormy16-elf build due to

commit e9bffec9afc45cf7c49308f0b4b8cc6bf68f58f2
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
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 1c072e9c40..19cefba5e6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2020-06-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* 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  <jose.marchesi@oracle.com>
 
 	* 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 75cd61b01d..665cdc0636 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 c2bab0d965..6bb5f2a3f0 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.26.2



More information about the Binutils mailing list