$ echo "abc" > xx.dat $ mips64el-linux-gnuabi64-ld -r -b binary xx.dat -o xx.o $ file xx.o xx.o: ELF 64-bit LSB relocatable, MIPS, MIPS-I version 1 (SYSV), not stripped while to link xx.o with real mips64 objects, it fails: Index: binutils-2.32.51.20190707/bfd/elfxx-mips.c =================================================================== --- binutils-2.32.51.20190707.orig/bfd/elfxx-mips.c +++ binutils-2.32.51.20190707/bfd/elfxx-mips.c @@ -12193,6 +12193,11 @@ mips_set_isa_flags (bfd *abfd) switch (bfd_get_mach (abfd)) { default: + if (ABI_N32_P (abfd) || ABI_64_P (abfd)) + val = E_MIPS_ARCH_3; + else + val = E_MIPS_ARCH_1; + break; case bfd_mach_mips3000: val = E_MIPS_ARCH_1; break; can convert it to: xx.o: ELF 64-bit LSB relocatable, MIPS, MIPS-III version 1 (SYSV), not stripped https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932287 https://buildd.debian.org/status/fetch.php?pkg=glib2.0&arch=mips64el&ver=2.61.1-2&stamp=1563280987&raw=0
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c7c860d2d29ca3e774c29f328d2af42eeb031958 commit c7c860d2d29ca3e774c29f328d2af42eeb031958 Author: YunQiang Su <syq@debian.org> Date: Thu Jul 25 16:34:58 2019 +0100 When linking binary files into MIPS executables, default to MIPS 3 emaulation for 64-bit objects. PR 24832 * elfxx-mips.c (mips_set_isa_flags): Default to MIPS 3 for 64-bit mips inputs.
Hi YunQiang, Thanks for the bug report and patch. I have applied the patch along with a changelog entry to the source repository. Cheers Nick