[v2,2/6] Add a psuedosection for the NT_FREEBSD_THRMISC note.

Message ID 1452721551-657-3-git-send-email-jhb@FreeBSD.org
State New, archived
Headers

Commit Message

John Baldwin Jan. 13, 2016, 9:45 p.m. UTC
  bfd/ChangeLog:

	* elf.c (elfcore_grok_note): Recognize NT_FREEBSD_THRMISC notes.
---
 bfd/ChangeLog | 4 ++++
 bfd/elf.c     | 7 +++++++
 2 files changed, 11 insertions(+)
  

Comments

Alan Modra Jan. 14, 2016, 5:28 a.m. UTC | #1
On Wed, Jan 13, 2016 at 01:45:47PM -0800, John Baldwin wrote:
> bfd/ChangeLog:
> 
> 	* elf.c (elfcore_grok_note): Recognize NT_FREEBSD_THRMISC notes.

OK.
  

Patch

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d1c5a3b..fb9bb61 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@ 
+2016-01-09  John Baldwin  <jhb@FreeBSD.org>
+
+	* elf.c (elfcore_grok_note): Recognize NT_FREEBSD_THRMISC notes.
+
 2016-01-08  Richard Sandiford  <richard.sandiford@arm.com>
 	    Jiong Wang  <jiong.wang@arm.com>
 
diff --git a/bfd/elf.c b/bfd/elf.c
index a1f857a..b2a50bf 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9287,6 +9287,13 @@  elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
     case NT_SIGINFO:
       return elfcore_make_note_pseudosection (abfd, ".note.linuxcore.siginfo",
 					      note);
+
+    case NT_FREEBSD_THRMISC:
+      if (note->namesz == 8
+	  && strcmp (note->namedata, "FreeBSD") == 0)
+	return elfcore_make_note_pseudosection (abfd, ".thrmisc", note);
+      else
+	return TRUE;
     }
 }