public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: liuzhensong <liuzhensong@loongson.cn>
To: binutils@sourceware.org
Cc: liuzhensong <liuzhensong@loongson.cn>
Subject: [PATCH] gas:LoongArch: Fix "make check" pr21884 fail in LoongArch32.
Date: Mon, 14 Mar 2022 10:46:51 +0800	[thread overview]
Message-ID: <20220314024651.1147572-1-liuzhensong@loongson.cn> (raw)

  gas/config/
    * tc-loongarch.c: Add function to select target mach.
    * tc-loongarch.h: Define macro TARGET_MACH.
---
 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
 
-- 
2.31.1


                 reply	other threads:[~2022-03-14  2:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220314024651.1147572-1-liuzhensong@loongson.cn \
    --to=liuzhensong@loongson.cn \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).