From patchwork Tue Sep 19 20:48:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 22964 Received: (qmail 72060 invoked by alias); 19 Sep 2017 20:48:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 71954 invoked by uid 89); 19 Sep 2017 20:48:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=SECTION X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Sep 2017 20:48:30 +0000 Received: from ralph.baldwin.cx.com (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id D733E10A7DB; Tue, 19 Sep 2017 16:48:22 -0400 (EDT) From: John Baldwin 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 13:48:13 -0700 Message-Id: <20170919204814.93328-2-jhb@FreeBSD.org> In-Reply-To: <20170919204814.93328-1-jhb@FreeBSD.org> References: <20170919204814.93328-1-jhb@FreeBSD.org> X-IsSubscribed: yes 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 + + * elf.c: Include "elf/mips.h". + (elfcore_grok_freebsd_prstatus): Account for padding in MIPS N32 + NT_PRSTATUS notes. + 2017-09-19 Alan Modra 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. */