[1/2] Account for padding in FreeBSD/mipsn32 NT_PRSTATUS notes.
Commit Message
bfd/ChangeLog:
* elf.c: Include "elf/mips.h".
(elfcore_grok_freebsd_prstatus): Account for padding in MIPS N32
NT_PRSTATUS notes.
---
bfd/ChangeLog | 6 ++++++
bfd/elf.c | 5 ++++-
2 files changed, 10 insertions(+), 1 deletion(-)
@@ -1,3 +1,9 @@
+2017-09-19 John Baldwin <jhb@FreeBSD.org>
+
+ * elf.c: Include "elf/mips.h".
+ (elfcore_grok_freebsd_prstatus): Account for padding in MIPS N32
+ NT_PRSTATUS notes.
+
2017-09-19 Alan Modra <amodra@gmail.com>
PR 21441
@@ -43,6 +43,7 @@ SECTION
#include "libiberty.h"
#include "safe-ctype.h"
#include "elf-linux-core.h"
+#include "elf/mips.h"
#ifdef CORE_HEADER
#include CORE_HEADER
@@ -9955,7 +9956,9 @@ elfcore_grok_freebsd_prstatus (bfd *abfd, Elf_Internal_Note *note)
offset += 4;
/* Padding before pr_reg. */
- if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64)
+ if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64
+ || (elf_elfheader (abfd)->e_machine == EM_MIPS
+ && (elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0))
offset += 4;
/* Make sure that there is enough data remaining in the note. */