public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: YunQiang Su <yunqiang.su@cipunited.com>
Cc: binutils@sourceware.org,  syq@debian.org,  macro@orcam.me.uk,
	 xry111@xry111.site,  jiaxun.yang@flygoat.com
Subject: Re: [PATCH] MIPS: allow link o32 objects with mach mips64r6 and mips32r6
Date: Mon, 13 Feb 2023 15:47:25 +0000	[thread overview]
Message-ID: <mpt5yc5y3ci.fsf@arm.com> (raw)
In-Reply-To: <20230207024424.4000862-1-yunqiang.su@cipunited.com> (YunQiang Su's message of "Tue, 7 Feb 2023 10:44:24 +0800")

Sorry for the slow reply.

YunQiang Su <yunqiang.su@cipunited.com> writes:
> The `-32 -mips32r6` and `-32 mips64r6` option of gnu as
> will generate objects with different mach attributes.
>
>    0x90001407, noreorder, pic, cpic, nan2008, o32, mips32r6
> vs
>    0xa0001507, noreorder, pic, cpic, 32bitmode, nan2008, o32, mips64r6
>
> Let's allow link them togather, just like we did for r2 ones.
>
> bfd/ChangeLog:
>
> 	* elfxx-mips.c (mips_mach_extends_p): allow link o32 objects
> 	with mach mips64r6 and mips32r6.

Looks good, but how about making this more systematic by applying
it to all mipsisa32 revisions?  E.g. have a second array of
mips_mach_extension objects that gives the mipsisa32 base and corresponding
mipsisa64 "extension" (ok, maybe not really an accurate term in this case,
but good enough).

Thanks,
Richard


> ---
>  bfd/elfxx-mips.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
> index e9fb61ff9e7..1790b78e822 100644
> --- a/bfd/elfxx-mips.c
> +++ b/bfd/elfxx-mips.c
> @@ -14600,6 +14600,10 @@ mips_mach_extends_p (unsigned long base, unsigned long extension)
>        && mips_mach_extends_p (bfd_mach_mipsisa64r2, extension))
>      return true;
>  
> +  if (base == bfd_mach_mipsisa32r6
> +      && mips_mach_extends_p (bfd_mach_mipsisa64r6, extension))
> +    return true;
> +
>    for (i = 0; i < ARRAY_SIZE (mips_mach_extensions); i++)
>      if (extension == mips_mach_extensions[i].extension)
>        {

  reply	other threads:[~2023-02-13 15:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  2:44 YunQiang Su
2023-02-13 15:47 ` Richard Sandiford [this message]
2023-02-21  4:06 ` [PATCH] MIPS: make mipsisa32 and mipsisa64 link more systematic YunQiang Su
2023-02-27 14:56   ` Richard Sandiford
2023-03-02  1:52   ` [PATCH v2] " YunQiang Su
2023-03-05 13:38     ` YunQiang Su
2023-03-20  1:32       ` YunQiang Su
2023-04-03  3:59         ` YunQiang Su
2023-04-03 14:03     ` Richard Sandiford
2023-04-10  6:48       ` YunQiang Su
2023-04-10  6:51       ` [PATCH v3] " YunQiang Su
2023-04-12 12:26         ` Richard Sandiford

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=mpt5yc5y3ci.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=binutils@sourceware.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=macro@orcam.me.uk \
    --cc=syq@debian.org \
    --cc=xry111@xry111.site \
    --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).