From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org, binutils@sourceware.org
Subject: [PATCH 1/2] Account for padding in FreeBSD/mipsn32 NT_PRSTATUS notes.
Date: Tue, 19 Sep 2017 20:48:00 -0000 [thread overview]
Message-ID: <20170919204814.93328-2-jhb@FreeBSD.org> (raw)
In-Reply-To: <20170919204814.93328-1-jhb@FreeBSD.org>
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(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4c8c12cd46..d7cd445b11 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elf.c b/bfd/elf.c
index 2aa2337724..d8d29ac70b 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -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. */
--
2.13.3
next prev parent reply other threads:[~2017-09-19 20:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 20:48 [PATCH 0/2] Support for FreeBSD/mips N32 John Baldwin
2017-09-19 20:48 ` [PATCH 2/2] Add a signal frame unwinder for FreeBSD/mipsn32 John Baldwin
2017-10-11 11:16 ` Pedro Alves
2017-09-19 20:48 ` John Baldwin [this message]
2017-09-20 2:01 ` [PATCH 0/2] Support for FreeBSD/mips N32 Alan Modra
2017-09-20 4:25 ` John Baldwin
2017-09-26 21:09 ` John Baldwin
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=20170919204814.93328-2-jhb@FreeBSD.org \
--to=jhb@freebsd.org \
--cc=binutils@sourceware.org \
--cc=gdb-patches@sourceware.org \
/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