From patchwork Thu Jun 16 06:02:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 13127 Received: (qmail 17379 invoked by alias); 16 Jun 2016 06:11:27 -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 11428 invoked by uid 89); 16 Jun 2016 06:11:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=auxiliary, elfc, UD:elf.c, sk:nt_free X-Spam-User: qpsmtpd, 2 recipients X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 16 Jun 2016 06:11:21 +0000 Received: from ralph.baldwin.cx.net (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CD564B9AB; Thu, 16 Jun 2016 02:02:18 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org, binutils@sourceware.org Subject: [PATCH 4/6] Create a psuedo section for the ELF AUXV core dump note on FreeBSD. Date: Wed, 15 Jun 2016 23:02:00 -0700 Message-Id: <20160616060202.63470-5-jhb@FreeBSD.org> In-Reply-To: <20160616060202.63470-1-jhb@FreeBSD.org> References: <20160616060202.63470-1-jhb@FreeBSD.org> X-IsSubscribed: yes The procstat AUXV core dump note in FreeBSD consists of 32-bit integer followed by an array of auxiliary vector entries. bfd/ChangeLog: * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PROCSTAT_AUXV notes. --- bfd/ChangeLog | 5 +++++ bfd/elf.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 881ce6d..7afc44e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2016-06-15 John Baldwin + * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PROCSTAT_AUXV + notes. + +2016-06-15 John Baldwin + * elf.c (elfcore_grok_note): Remove handling of NT_X86_XSTATE for FreeBSD. Remove case for NT_FREEBSD_THRMISC. (elfcore_grok_freebsd_psinfo): New function. diff --git a/bfd/elf.c b/bfd/elf.c index 2d8f621..d947cf3 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -9663,6 +9663,20 @@ elfcore_grok_freebsd_note (bfd *abfd, Elf_Internal_Note *note) else return TRUE; + case NT_FREEBSD_PROCSTAT_AUXV: + { + asection *sect = bfd_make_section_anyway_with_flags (abfd, ".auxv", + SEC_HAS_CONTENTS); + + if (sect == NULL) + return FALSE; + sect->size = note->descsz - 4; + sect->filepos = note->descpos + 4; + sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32; + + return TRUE; + } + case NT_X86_XSTATE: if (note->namesz == 8) return elfcore_grok_xstatereg (abfd, note);