Re: [PATCH 1/3] BFD: Write Linux core PRSTATUS note into MIPS core file

Maciej W. Rozycki
2017-10-18T13:36:23Z

On Tue, 17 Oct 2017, Djordje Todorovic wrote:

> diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
> index 17ca432..2ee15e9 100644
> --- a/bfd/elf32-mips.c
> +++ b/bfd/elf32-mips.c
> @@ -2373,6 +2373,45 @@ elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
>
> return TRUE;
> }
> +
> +/* Write Linux core PRSTATUS note into core file. */
> +
> +static char *
> +elf32_mips_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type,
> + ...)

Formatting: please align the wrapped line to the inside of the opening
parenthesis above, i.e.:

elf32_mips_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type,
...)

> @@ -2554,6 +2593,9 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
> #define ELF_COMMONPAGESIZE 0x1000
> #define elf32_bed elf32_tradbed
>
> +#undef elf_backend_write_core_note
> +#define elf_backend_write_core_note elf32_mips_write_core_note

Formatting: please use tabs to align the RHS to column #40 like all the
other such definitions.

> diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
> index d51124b..f3997bd 100644
> --- a/bfd/elf64-mips.c
> +++ b/bfd/elf64-mips.c
> @@ -4248,6 +4248,45 @@ elf64_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
>
> return TRUE;
> }
> +
> +/* Write Linux core PRSTATUS note into core file. */
> +
> +static char *
> +elf64_mips_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type,
> + ...)

Formatting.

> @@ -4454,6 +4493,9 @@ const struct elf_size_info mips_elf64_size_info =
> #define ELF_COMMONPAGESIZE 0x1000
> #define elf64_bed elf64_tradbed
>
> +#undef elf_backend_write_core_note
> +#define elf_backend_write_core_note elf64_mips_write_core_note

Formatting.

> diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
> index fdae183..d9d2020 100644
> --- a/bfd/elfn32-mips.c
> +++ b/bfd/elfn32-mips.c
> @@ -3630,6 +3630,45 @@ elf_n32_mips_grok_freebsd_prstatus (bfd *abfd, Elf_Internal_Note *note)
> return _bfd_elfcore_make_pseudosection (abfd, ".reg",
> size, note->descpos + offset);
> }
> +
> +/* Write Linux core PRSTATUS note into core file. */
> +
> +static char *
> +elf32_mips_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type,
> + ...)

Formatting.

> @@ -3807,6 +3846,9 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
> #define ELF_COMMONPAGESIZE 0x1000
> #define elf32_bed elf32_tradbed
>
> +#undef elf_backend_write_core_note
> +#define elf_backend_write_core_note elf32_mips_write_core_note

Formatting.

Maciej