public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Ying Huang" <ying.huang@oss.cipunited.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: <libc-alpha@sourceware.org>, <yunqiang.su@oss.cipunited.com>
Subject: Re: [PATCH v3] MIPS: Sync elf.h from binutils
Date: Fri, 02 Jun 2023 11:31:18 +0800	[thread overview]
Message-ID: <261b7938-4e14-76f4-d0fa-cefa71d0fb3f@oss.cipunited.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2306011431330.59991@angie.orcam.me.uk>

[-- Attachment #1: Type: text/plain, Size: 3964 bytes --]

Hi Maciej,

在 2023/6/1 23:35, Maciej W. Rozycki 写道:
> On Tue, 16 May 2023, Ying Huang wrote:
>
>> 1.Add new MIPS related declarations, specifically the following:
>> relocation types, machine flags, section type names,
>> GNU attribute tags, values of Tag_GNU_MIPS_ABI_FP.
>> On mips64, up to three reloc types may be specified per r_info,
>> by the fields r_type, r_type2, and r_type3, so add new macros
>> to get reloc type for mips64.
>> 2.update sysdeps/mips/dl-machine-reject-phdr.h
>  I suggest rephrasing and reformatting the commit description a little for 
> clarity and to follow the GNU Coding Standards.  How about:
>
> 1. Add new definitions for the MIPS target, specifically: relocation 
>    types, machine flags, section type names, and object attribute tags 
>    and values.  On MIPS64, up to three relocations may be specified 
>    within r_info, by the r_type, r_type2, and r_type3 fields, so add new 
>    macros to get the respective reloc types for MIPS64.
>
> 2. Update sysdeps/mips/dl-machine-reject-phdr.h for 2008 NaN support.
>
> ?  However I think the two parts need to be separate patches, as the first 
> part is a mechanical update for bits we've been missing and the second one 
> is a semantics change.
>
>> diff --git a/elf/elf.h b/elf/elf.h
>> index 94ca23c1bb..e1a6ace066 100644
>> --- a/elf/elf.h
>> +++ b/elf/elf.h
>> @@ -678,6 +678,9 @@ typedef Elf64_Xword	Elf64_Relr;
>>  
>>  #define ELF64_R_SYM(i)			((i) >> 32)
>>  #define ELF64_R_TYPE(i)			((i) & 0xffffffff)
>> +#define ELF64_MIPS_R_TYPE(i)		((i) & 0xff)
>> +#define ELF64_MIPS_R_TYPE2(i)           (((i) >> 8) & 0xff)
>> +#define ELF64_MIPS_R_TYPE3(i)           (((i) >> 16) & 0xff)
>  There's something odd with indentation here.  Please substitute spaces 
> with tabs throughout your additions, making sure the horizontal alignment 
> of the right-hand side is correct (it might be wrong in binutils here or 
> there, but it should be fixed there rather than propagated here).
>
>> diff --git a/sysdeps/mips/dl-machine-reject-phdr.h b/sysdeps/mips/dl-machine-reject-phdr.h
>> index 104b590661..edea869c46 100644
>> --- a/sysdeps/mips/dl-machine-reject-phdr.h
>> +++ b/sysdeps/mips/dl-machine-reject-phdr.h
>> @@ -139,7 +141,8 @@ static const struct abi_req reqs[Val_GNU_MIPS_ABI_FP_MAX + 1] =
>>       {false, false, false, false, false}, /* old-FP64 */
>>       {false, false, true,  true,  true},  /* FPXX */
>>       {false, false, false, true,  false}, /* FP64 */
>> -     {false, false, false, true,  true}}; /* FP64A */
>> +     {false, false, false, true,  true},  /* FP64A */
>> +     {false, false, true,  true,  true}}; /* NAN2008 */
>  It doesn't make sense to me.  The use of Val_GNU_MIPS_ABI_FP_NAN2008 has 
> been superseded (in favour to EF_MIPS_NAN2008, set independently from any 
> FP ABI so that you can make combinations), e.g. GAS has this piece:
>
>     case Val_GNU_MIPS_ABI_FP_NAN2008:
>       /* Silently ignore compatibility value.  */
>       break;
>
> And LD issues a warning about an unknown FP ABI whenever linking a set of 
> modules involving ones marked with this value and ones marked with any 
> other value except for Val_GNU_MIPS_ABI_FP_ANY both at a time.
>
>  I think we should also reject such combinations.  It surely makes no 
> sense to consider 2008 NaN incompatible and compatible with single and 
> double float respectively, as your change proposes.
>
>  Have you actually seen this attribute value in the wild though (e.g. by 
> triggering the "uses unknown FP ABI" error here)?  And where did you get 
> this piece of code from anyway?
>
>   Maciej

I did not see error "unknown FP ABI" and update this file for considering to avoid this error.

Thannks for your suggestion and I would fix the whole code alignment problem and rewrite commit message.

And submit patch v4 that only contains sync elf.h file.


Thanks,

Ying

      reply	other threads:[~2023-06-02  3:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16  9:40 Ying Huang
2023-06-01 15:35 ` Maciej W. Rozycki
2023-06-02  3:31   ` Ying Huang [this message]

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=261b7938-4e14-76f4-d0fa-cefa71d0fb3f@oss.cipunited.com \
    --to=ying.huang@oss.cipunited.com \
    --cc=libc-alpha@sourceware.org \
    --cc=macro@orcam.me.uk \
    --cc=yunqiang.su@oss.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).