Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
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: Thu, 16 Jun 2016 06:11:00 -0000	[thread overview]
Message-ID: <20160616060202.63470-5-jhb@FreeBSD.org> (raw)
In-Reply-To: <20160616060202.63470-1-jhb@FreeBSD.org>

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  <jhb@FreeBSD.org>
 
+	* elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PROCSTAT_AUXV
+	notes.
+
+2016-06-15  John Baldwin  <jhb@FreeBSD.org>
+
 	* 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);
-- 
2.8.4


  parent reply	other threads:[~2016-06-16  6:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16  6:02 [PATCH 0/6] Add ELF auxiliary vector handling for FreeBSD John Baldwin
2016-06-16  6:02 ` [PATCH 3/6] Fetch the ELF auxiliary vector from live processes on FreeBSD John Baldwin
2016-06-20 23:01   ` Pedro Alves
2016-06-16  6:02 ` [PATCH 1/6] Add constants for FreeBSD-specific auxiliary vector entry types John Baldwin
2016-06-17  8:27   ` Nick Clifton
2016-06-16  6:02 ` [PATCH 6/6] Add a gdbarch 'print_auxv' method for FreeBSD ABIs John Baldwin
2016-06-20 23:43   ` Pedro Alves
2016-06-16  6:02 ` [PATCH 2/6] Add elfcore_grok_freebsd_note to parse FreeBSD ELF core notes John Baldwin
2016-06-17  8:28   ` Nick Clifton
2016-06-16  6:11 ` John Baldwin [this message]
2016-06-17  8:28   ` [PATCH 4/6] Create a psuedo section for the ELF AUXV core dump note on FreeBSD Nick Clifton
2016-06-20 23:45   ` Pedro Alves
2016-06-16  6:11 ` [PATCH 5/6] Add a new gdbarch method to print a single AUXV entry John Baldwin
2016-06-20 23:40   ` Pedro Alves
2016-06-23 20:19     ` John Baldwin
2016-06-20 17:10 ` [PATCH 0/6] Add ELF auxiliary vector handling for FreeBSD 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=20160616060202.63470-5-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