[RFC][PATCH] Add Solaris specific ELF note processing.

Alan Modra amodra@gmail.com
Wed Jul 28 09:14:14 GMT 2021


On Mon, Jul 19, 2021 at 07:09:47AM +0000, Libor Bukata via Binutils wrote:
> diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
> index b3f56b8c2ce..2427fcb1414 100644
> --- a/bfd/elf-bfd.h
> +++ b/bfd/elf-bfd.h
> @@ -1377,6 +1377,11 @@ struct elf_backend_data
>    bool (*elf_backend_grok_freebsd_prstatus)
>      (bfd *, Elf_Internal_Note *);
>  
> +  /* This function, if defined, is called when a "Solaris" NT_LWPSTATUS
> +     note is found in a core file.  */
> +  bool (*elf_backend_grok_lwpstatus)
> +    (bfd *, Elf_Internal_Note *);
> +

Why did you add this?  There is no place where it is defined as
anything other than NULL.

>    /* This function, if defined, is called to write a note to a corefile.  */
>    char *(*elf_backend_write_core_note)
>      (bfd *abfd, char *buf, int *bufsiz, int note_type, ...);
> diff --git a/bfd/elf.c b/bfd/elf.c
> index de5abafabf0..d39b4bd3b88 100644
> --- a/bfd/elf.c
> +++ b/bfd/elf.c
> @@ -9717,7 +9717,10 @@ elfcore_make_note_pseudosection (bfd *abfd,
>  static bool
>  elfcore_grok_prfpreg (bfd *abfd, Elf_Internal_Note *note)
>  {
> -  return elfcore_make_note_pseudosection (abfd, ".reg2", note);
> +  asection *sect = bfd_get_section_by_name (abfd, ".reg2");
> +  if (sect == NULL)
> +    return elfcore_make_note_pseudosection (abfd, ".reg2", note);
> +  return true;
>  }
>  
>  /* Linux dumps the Intel SSE regs in a note named "LINUX" with a note

The above was not described or mentioned in a ChangeLog.  Why do you
need this?

There are also rather a lot of formatting errors in the rest of the
patch.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list