public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: binutils@sourceware.org, gdb-patches@sourceware.org
Subject: [PATCH 1/5] elfcore_grok_freebsd_note: Remove checks of note->namesz.
Date: Thu, 24 Mar 2022 13:56:12 -0700	[thread overview]
Message-ID: <20220324205616.8517-2-jhb@FreeBSD.org> (raw)
In-Reply-To: <20220324205616.8517-1-jhb@FreeBSD.org>

This function is only called if the note name is "FreeBSD", so
checking the name size is unnecessary.

bfd/ChangeLog:

	* elf.c (elfcore_grok_freebsd_note): Remove checks for namesz.
---
 bfd/ChangeLog |  4 ++++
 bfd/elf.c     | 10 ++--------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 86d42b2d639..d1a31efe59c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2022-03-23  John Baldwin  <jhb@FreeBSD.org>
+
+	* elf.c (elfcore_grok_freebsd_note): Remove checks for namesz.
+
 2022-03-22  Steiner H Gunderson  <steinar+sourceware@gunderson.no>
 
 	* dwarf2.c (_bfd_dwarf2_find_nearest_line): if a function name is
diff --git a/bfd/elf.c b/bfd/elf.c
index 82b53be99f9..a99149e50b3 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -11010,10 +11010,7 @@ elfcore_grok_freebsd_note (bfd *abfd, Elf_Internal_Note *note)
       return elfcore_grok_freebsd_psinfo (abfd, note);
 
     case NT_FREEBSD_THRMISC:
-      if (note->namesz == 8)
-	return elfcore_make_note_pseudosection (abfd, ".thrmisc", note);
-      else
-	return true;
+      return elfcore_make_note_pseudosection (abfd, ".thrmisc", note);
 
     case NT_FREEBSD_PROCSTAT_PROC:
       return elfcore_make_note_pseudosection (abfd, ".note.freebsdcore.proc",
@@ -11031,10 +11028,7 @@ elfcore_grok_freebsd_note (bfd *abfd, Elf_Internal_Note *note)
       return elfcore_make_auxv_note_section (abfd, note, 4);
 
     case NT_X86_XSTATE:
-      if (note->namesz == 8)
-	return elfcore_grok_xstatereg (abfd, note);
-      else
-	return true;
+      return elfcore_grok_xstatereg (abfd, note);
 
     case NT_FREEBSD_PTLWPINFO:
       return elfcore_make_note_pseudosection (abfd, ".note.freebsdcore.lwpinfo",
-- 
2.34.1


  reply	other threads:[~2022-03-24 20:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 20:56 [PATCH 0/5] Handle FreeBSD's NT_X86_SEGBASES core dump note John Baldwin
2022-03-24 20:56 ` John Baldwin [this message]
2022-03-24 20:56 ` [PATCH 2/5] Recognize FreeBSD core dump note for x86 segment base registers John Baldwin
2022-03-24 20:56 ` [PATCH 3/5] Use pseudosections for NT_FREEBSD_X86_SEGBASES core dump notes John Baldwin
2022-03-24 20:56 ` [PATCH 4/5] FreeBSD/x86: Read segment base registers from NT_X86_SEGBASES John Baldwin
2022-03-24 20:56 ` [PATCH 5/5] Use I386_GSBASE_REGNUM in i386fbsd_get_thread_local_address 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=20220324205616.8517-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).