[PATCH v4 1/2] MIPS: support mips*64 as CPU and gnuabi64 as ABI

YunQiang Su syq@debian.org
Fri Jul 21 12:30:04 GMT 2023


Maciej W. Rozycki <macro@orcam.me.uk> 于2023年7月21日周五 19:54写道:
>
> On Fri, 21 Jul 2023, YunQiang Su wrote:
>
> > Maciej W. Rozycki <macro@orcam.me.uk> 于2023年7月21日周五 18:01写道:
> > >
> > > Nick, please hold on with 2.41 until this incompatible ABI change has been
> > > sorted.
> > >
> > > On Wed, 19 Apr 2023, Richard Sandiford wrote:
> > >
> > > > > For MIPS64r6 ports, Debian as an example, `mipsisa64r6el` is
> > > > > used as the cpu name in triple.
> > > > > Let's recognize them by `mips*64*(el)`.
> > > > >
> > > > > For 64bit Ports, like Debian's mips64el and mips64r6el ports,
> > > > > `gnuabi64` is used as the abi section.
> > > > > Let's use N64 abi by default for the triple with gnuabi64.
> > > > > ---
> > > > >  bfd/config.bfd                                     | 14 ++++++++++++--
> > > > >  .../testsuite/binutils-all/mips/mips-note-2-n32.d  |  1 +
> > > > >  gas/configure                                      |  5 ++++-
> > > > >  gas/configure.ac                                   |  5 ++++-
> > > > >  gold/configure.tgt                                 | 14 ++++++++++++++
> > > > >  ld/configure.tgt                                   | 12 ++++++++++--
> > > > >  6 files changed, 45 insertions(+), 6 deletions(-)
> > > >
> > > > OK, thanks.
> > >
> > >  So this has changed the default ABI from o32 to n32 for `mipsisa64-*-*'
> >
> > I think that maybe you have a misunderstanding.
> > 1. It is *not* for `mipsisa64-*-*', it is for `mipsisa64-*-gnuabi64'
> > 2. It is not from O32 to N32. It is from N32 to N64.
>
>  Well test results say otherwise.  Please build yourself binutils for
> `mipsisa64-linux' and see what output format it uses with and without this
> change.
>

Ohh you are right, while, does mips*-linux without ABI section really matter?
I never hear about it is used for any real system.



>  I have:
>
> $ mipsisa64-linux/gas/as-new /dev/null -o null.o
> $ file null.o
> null.o: ELF 32-bit MSB relocatable, MIPS, MIPS64 version 1 (SYSV), not stripped

I cannot reproduce it. My test result is:
null.o: ELF 32-bit MSB relocatable, MIPS, N32 MIPS64 version 1 (SYSV),
not stripped
                                                                   ^^

> $ mipsisa64-linux/ld/ld-new -e 0 null.o -o null
> $ file null
> null: ELF 32-bit MSB executable, MIPS, MIPS64 version 1 (SYSV), statically linked, not stripped
> $
>
> as at commit 32f1c80375eb^, and:
>
> $ mipsisa64-linux/gas/as-new /dev/null -o null.o
> $ file null.o
> null.o: ELF 32-bit MSB relocatable, MIPS, MIPS64 version 1 (SYSV), not stripped
> $ mipsisa64-linux/ld/ld-new -e 0 null.o -o null
> mipsisa64-linux/ld/ld-new: null.o: ABI is incompatible with that of the selected emulation
> mipsisa64-linux/ld/ld-new: failed to merge target specific data of file null.o
> $
>
> as from commit 32f1c80375eb.  The default format used by LD is now not the
> same as one produced by GAS.
>

Yes. we should keep them sync. Since it has CPU `mipsisa64*`, so, I
think that we should
use N32 or N64.

Ohh, yes, my patch switch the default output of mips*isa64-linux to
N32 from O32.
I believe that it is an correct modification.

>   Maciej


More information about the Binutils mailing list