diff options
author | liuzhensong <liuzhensong@loongson.cn> | 2022-03-13 16:49:07 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2022-03-20 09:37:12 +0800 |
commit | 96a671f28153f114aacc41f4c0362816a92509a7 (patch) | |
tree | cc39decf10c49d42dc5145e200ae03d76448e402 /gas | |
parent | 2a04204dff733c85a35dcbcd59b2f06474bbd1ff (diff) | |
download | gdb-96a671f28153f114aacc41f4c0362816a92509a7.zip gdb-96a671f28153f114aacc41f4c0362816a92509a7.tar.gz gdb-96a671f28153f114aacc41f4c0362816a92509a7.tar.bz2 |
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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-loongarch.c | 6 | ||||
-rw-r--r-- | gas/config/tc-loongarch.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index 15fc4fa..08203d2 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 705d45a..2664da5 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 |