This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Collision between NT_GNU_BUILD_ATTRIBUTE_OPEN and NT_PPC_VMX


Thanks Alan! :-)

On 12-08-2017 05:13, Alan Modra wrote:
> On Sat, Aug 12, 2017 at 10:52:51AM +0930, Alan Modra wrote:
>> On Fri, Aug 11, 2017 at 04:03:26PM -0700, H.J. Lu wrote:
>>> This is wrong.  pnote->type is unique only for a given pnote->namedata.
>>
>> That is true.  According to the gABI, the name is supposed to be the
>> originator of the note, and the type is decoded depending on the name.
>>
>>>  NT_GNU_* should be be checked for "GNU" notes.
>>
>> Well, yes, but NT_GNU_BUILD_ATTRIBUTE_* doesn't use "GNU".  The
>> proposal at https://fedoraproject.org/wiki/Toolchain/Watermark says
>> they ought to start with "GA", and even that stretches the gABI
>> description of notes, but the support and testcases Nick committed
>> omit "GA".  So we don't have anything remotely like an originator
>> string.  The name dives straight into data.  :-(
> 
> OK, so I thought I'd have another look at this (escaping outside
> work in the garden).  It seems from the objcopy code that the "GA"
> style is version 2 of these notes.  Good!
> 
> Here is what I'm going to commit.
> 
> 	* readelf.c (process_note): Qualify NT_GNU_BUILD_ATTRIBUTE notes
> 	by name data.
> 
> diff --git a/binutils/readelf.c b/binutils/readelf.c
> index 2b15f0f..0fc6562 100644
> --- a/binutils/readelf.c
> +++ b/binutils/readelf.c
> @@ -17477,8 +17477,11 @@ process_note (Elf_Internal_Note *  pnote,
> 
>    printf ("  ");
> 
> -  if (pnote->type == NT_GNU_BUILD_ATTRIBUTE_OPEN
> -      || pnote->type == NT_GNU_BUILD_ATTRIBUTE_FUNC)
> +  if (((const_strneq (pnote->namedata, "GA")
> +	&& strchr ("*$!+", pnote->namedata[2]) != NULL)
> +       || strchr ("*$!+", pnote->namedata[0]) != NULL)
> +      && (pnote->type == NT_GNU_BUILD_ATTRIBUTE_OPEN
> +	  || pnote->type == NT_GNU_BUILD_ATTRIBUTE_FUNC))
>      print_gnu_build_attribute_name (pnote);
>    else
>      print_symbol (-20, name);
> @@ -17496,8 +17499,11 @@ process_note (Elf_Internal_Note *  pnote,
>      return print_stapsdt_note (pnote);
>    else if (const_strneq (pnote->namedata, "CORE"))
>      return print_core_note (pnote);
> -  else if (pnote->type == NT_GNU_BUILD_ATTRIBUTE_OPEN
> -	   || pnote->type == NT_GNU_BUILD_ATTRIBUTE_FUNC)
> +  else if (((const_strneq (pnote->namedata, "GA")
> +	     && strchr ("*$!+", pnote->namedata[2]) != NULL)
> +	    || strchr ("*$!+", pnote->namedata[0]) != NULL)
> +	   && (pnote->type == NT_GNU_BUILD_ATTRIBUTE_OPEN
> +	       || pnote->type == NT_GNU_BUILD_ATTRIBUTE_FUNC))
>      return print_gnu_build_attribute_description (pnote, file);
> 
>    if (pnote->descsz)
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]