From: Xi Ruoyao <xry111@xry111.site>
To: Richard Sandiford <richard.sandiford@arm.com>,
YunQiang Su <syq@debian.org>
Cc: YunQiang Su <yunqiang.su@cipunited.com>,
gcc-patches@gcc.gnu.org, macro@orcam.me.uk,
jiaxun.yang@flygoat.com
Subject: Re: [PATCH] MIPS: use arch_32/64 instead of default_mips_arch
Date: Fri, 03 Feb 2023 22:34:27 +0800 [thread overview]
Message-ID: <90a55d73f1d33299969d2a72938e4534185b39cd.camel@xry111.site> (raw)
In-Reply-To: <mpt8rhec03r.fsf@arm.com>
On Fri, 2023-02-03 at 14:08 +0000, Richard Sandiford via Gcc-patches
wrote:
> > Do you mean that the "wrong" format is quite interesting?
> > Yes, While this format is never used at all.
>
> My point was that there is nothing wrong in principle with creating
> an o32 executable that has a 64-bit rather than a 32-bit ISA (since
> the
> 64-bit ISAs are pure extensions of 32-bit ISAs). Doing that is even
> useful in some cases. For example, MIPS4+O32 is a useful combination,
> even though MIPS4 is a 64-bit ISA. Same for Octeon3+O32, etc.
>
> So is the linker behaviour really correct? Doesn't it mean that
> Octeon3 O32 binaries are link-incompatible with MIPS32 o32 binaries?
On gcc230:
xry111@gcc230:~$ cat a.c
int a() { return 42; }
xry111@gcc230:~$ cat b.c
extern int a(void);
int main() { return a() ^ 42; }
xry111@gcc230:~$ cc a.c -mabi=32 -march=mips32r2 -c
xry111@gcc230:~$ cc b.c -mabi=32 -march=mips64r2 -c
xry111@gcc230:~$ cc a.o b.o
xry111@gcc230:~$ ./a.out && echo ok
ok
xry111@gcc230:~$
xry111@gcc230:~$ ld -version
GNU ld (GNU Binutils for Debian) 2.31.1
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
So I'd consider the issue a GNU ld regression if it suddenly stops to
behave like this.
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2023-02-03 14:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 9:05 YunQiang Su
2023-02-03 12:28 ` Richard Sandiford
2023-02-03 13:23 ` YunQiang Su
2023-02-03 14:08 ` Richard Sandiford
2023-02-03 14:34 ` Xi Ruoyao [this message]
2023-02-03 15:22 ` YunQiang Su
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=90a55d73f1d33299969d2a72938e4534185b39cd.camel@xry111.site \
--to=xry111@xry111.site \
--cc=gcc-patches@gcc.gnu.org \
--cc=jiaxun.yang@flygoat.com \
--cc=macro@orcam.me.uk \
--cc=richard.sandiford@arm.com \
--cc=syq@debian.org \
--cc=yunqiang.su@cipunited.com \
/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).