[binutils-gdb] gas:LoongArch: Fix "make check" pr21884 fail in LoongArch32.

liu & zhensong liuzhensong@sourceware.org
Sun Mar 20 01:48:20 GMT 2022


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=96a671f28153f114aacc41f4c0362816a92509a7

commit 96a671f28153f114aacc41f4c0362816a92509a7
Author: liuzhensong <liuzhensong@loongson.cn>
Date:   Sun Mar 13 16:49:07 2022 +0800

    gas:LoongArch: Fix "make check" pr21884 fail in LoongArch32.
    
      gas/config/
        * tc-loongarch.c: Add function to select target mach.
        * tc-loongarch.h: Define macro TARGET_MACH.

Diff:
---
 gas/config/tc-loongarch.c | 6 ++++++
 gas/config/tc-loongarch.h | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c
index 15fc4fa5e41..08203d291bd 100644
--- a/gas/config/tc-loongarch.c
+++ b/gas/config/tc-loongarch.c
@@ -354,6 +354,12 @@ md_begin ()
   assert (8 <= sizeof (offsetT));
 }
 
+unsigned long
+loongarch_mach (void)
+{
+  return LARCH_opts.ase_lp64 ? bfd_mach_loongarch64 : bfd_mach_loongarch32;
+}
+
 static const expressionS const_0 = { .X_op = O_constant, .X_add_number = 0 };
 
 static const char *
diff --git a/gas/config/tc-loongarch.h b/gas/config/tc-loongarch.h
index 705d45a4517..2664da59f51 100644
--- a/gas/config/tc-loongarch.h
+++ b/gas/config/tc-loongarch.h
@@ -24,6 +24,9 @@
 #define TARGET_BYTES_BIG_ENDIAN 0
 #define TARGET_ARCH bfd_arch_loongarch
 
+#define TARGET_MACH (loongarch_mach ())
+extern unsigned long loongarch_mach (void);
+
 #define WORKING_DOT_WORD 1
 #define REPEAT_CONS_EXPRESSIONS


More information about the Binutils-cvs mailing list