summaryrefslogtreecommitdiff
path: root/devel/gdb/files/commit-e330d4c033e
blob: 0d8b47fbd6b42d8679c0ec94bc10c20fe2d365ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
commit 1ec77d89016f9b26dde3de6cdc4f4eaa44bbff13
Author: John Baldwin <jhb@FreeBSD.org>
Date:   Fri Apr 1 13:16:46 2022 -0700

    elfcore_grok_freebsd_note: Remove checks of note->namesz.
    
    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.
    
    (cherry picked from commit e330d4c033eab2e0e7206a29d6c11a9a59fd205b)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6ac8b96c57a..ae8b25faae4 100644
--- bfd/ChangeLog
+++ bfd/ChangeLog
@@ -1,3 +1,7 @@
+2022-04-01  John Baldwin  <jhb@FreeBSD.org>
+
+	* elf.c (elfcore_grok_freebsd_note): Remove checks for namesz.
+
 2022-03-18  Viorel Preoteasa  <viorel.preoteasa@gmail.com>
 
 	PR 28924
diff --git a/bfd/elf.c b/bfd/elf.c
index 82b53be99f9..a99149e50b3 100644
--- bfd/elf.c
+++ 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",