summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-01 13:16:46 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-01 13:16:46 -0700
commita171378aa472fab0407dc1f99e8e7782286719ed (patch)
treeec638d9e646e1f5b2030fc20f6005511d20f185b
parente330d4c033eab2e0e7206a29d6c11a9a59fd205b (diff)
downloadbinutils-gdb-a171378aa472fab0407dc1f99e8e7782286719ed.tar.gz
Recognize FreeBSD core dump note for x86 segment base registers.
This core dump note contains the value of the base address of the %fs and %gs segments for both i386 and amd64 core dumps. It is primarily useful in resolving the address of TLS variables in core dumps. binutils/ChangeLog: * readelf.c (get_freebsd_elfcore_note_type): Handle NT_FREEBSD_X86_SEGBASES. include/ChangeLog: * elf/common.h (NT_FREEBSD_X86_SEGBASES): Define.
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c2
-rw-r--r--include/ChangeLog4
-rw-r--r--include/elf/common.h1
4 files changed, 12 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 81f74f5b2e6..63c425c7a68 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2022-04-01 John Baldwin <jhb@FreeBSD.org>
+
+ * readelf.c (get_freebsd_elfcore_note_type): Handle
+ NT_FREEBSD_X86_SEGBASES.
+
2022-03-31 Nick Clifton <nickc@redhat.com>
* arlex.l: Accept the plus character as part of a filename.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index a2dbaa4722e..84c8cfd45fc 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -20448,6 +20448,8 @@ get_freebsd_elfcore_note_type (Filedata * filedata, unsigned e_type)
return _("NT_PROCSTAT_AUXV (auxv data)");
case NT_FREEBSD_PTLWPINFO:
return _("NT_PTLWPINFO (ptrace_lwpinfo structure)");
+ case NT_FREEBSD_X86_SEGBASES:
+ return _("NT_X86_SEGBASES (x86 segment base registers)");
}
return get_note_type (filedata, e_type);
}
diff --git a/include/ChangeLog b/include/ChangeLog
index 82194629c97..502fc47c148 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2022-04-01 John Baldwin <jhb@FreeBSD.org>
+
+ * elf/common.h (NT_FREEBSD_X86_SEGBASES): Define.
+
2022-03-16 Simon Marchi <simon.marchi@efficios.com>
* elf/amdgpu.h: Add relocation values.
diff --git a/include/elf/common.h b/include/elf/common.h
index 70d63e3299c..ad62a7d8523 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -738,6 +738,7 @@
#define NT_FREEBSD_PROCSTAT_PSSTRINGS 15 /* Procstat ps_strings data. */
#define NT_FREEBSD_PROCSTAT_AUXV 16 /* Procstat auxv data. */
#define NT_FREEBSD_PTLWPINFO 17 /* Thread ptrace miscellaneous info. */
+#define NT_FREEBSD_X86_SEGBASES 0x200 /* x86 segment base registers */
/* Note segments for core files on NetBSD systems. Note name
must start with "NetBSD-CORE". */