diff options
author | YunQiang Su <yunqiang.su@cipunited.com> | 2023-04-18 21:49:22 +0800 |
---|---|---|
committer | YunQiang Su <yunqiang.su@cipunited.com> | 2023-04-23 14:32:43 +0800 |
commit | 9171de358f230b64646bbb525a74e5f8e3dbe0dc (patch) | |
tree | 790cfab7508b4b92c546dedc572745bf3b6fb2e7 /bfd | |
parent | 32f1c80375ebe8ad25d9805ee5889f0006c51e59 (diff) | |
download | gdb-9171de358f230b64646bbb525a74e5f8e3dbe0dc.zip gdb-9171de358f230b64646bbb525a74e5f8e3dbe0dc.tar.gz gdb-9171de358f230b64646bbb525a74e5f8e3dbe0dc.tar.bz2 |
MIPS: default output r6 obj if the triple is r6
If the triple is mipsisa32r6* or mipsisa64r6*, ld/as should output
r6 objects by default.
The triples with vendor `img` should do same.
The examples include:
as xx.s -o xx.o
ld -r -b binary xx.dat -o xx.o
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/config.bfd | 6 | ||||
-rw-r--r-- | bfd/elfxx-mips.c | 4 | ||||
-rw-r--r-- | bfd/elfxx-mips.h | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/bfd/config.bfd b/bfd/config.bfd index 1e4bea1..7875299 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -1535,3 +1535,9 @@ case "${targ_defvec} ${targ_selvecs}" in targ_archs="$targ_archs bfd_iamcu_arch" ;; esac + +case "${targ}" in + mipsisa32r6* | mipsisa64r6* | mips*-img-*) + targ_cflags="$targ_cflags -DMIPS_DEFAULT_R6=1" + ;; +esac diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 13a8995..c9cd2f8 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -12327,9 +12327,9 @@ mips_set_isa_flags (bfd *abfd) { default: if (ABI_N32_P (abfd) || ABI_64_P (abfd)) - val = E_MIPS_ARCH_3; + val = MIPS_DEFAULT_R6 ? E_MIPS_ARCH_64R6 : E_MIPS_ARCH_3; else - val = E_MIPS_ARCH_1; + val = MIPS_DEFAULT_R6 ? E_MIPS_ARCH_32R6 : E_MIPS_ARCH_1; break; case bfd_mach_mips3000: diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 4addf6f..f15dcea 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -29,6 +29,10 @@ enum reloc_check check_shuffle }; +#ifndef MIPS_DEFAULT_R6 +#define MIPS_DEFAULT_R6 0 +#endif + extern bool _bfd_mips_elf_mkobject (bfd *); extern bool _bfd_mips_elf_close_and_cleanup |