aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
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
commitb5c2367c3ac5f696221d9c24f470498abdb83257 (patch)
treef9355ff7dc4bb40ea01795cdfab9e9eb2a3afa54 /bfd/elf.c
parenta171378aa472fab0407dc1f99e8e7782286719ed (diff)
downloadgdb-b5c2367c3ac5f696221d9c24f470498abdb83257.zip
gdb-b5c2367c3ac5f696221d9c24f470498abdb83257.tar.gz
gdb-b5c2367c3ac5f696221d9c24f470498abdb83257.tar.bz2
Use pseudosections for NT_FREEBSD_X86_SEGBASES core dump notes.
This includes adding pseudosections when reading a core dump as well as support for writing out a core dump note from a pseudosection. bfd/ChangeLog: * elf-bfd.h (elfcore_write_x86_segbases): New. * elf.c (elfcore_grok_freebsd_note): Add pseudosections for NT_FREEBSD_X86_SEGBASES register notes. (elfcore_write_x86_segbases): New. (elfcore_write_register_note): Write NT_FREEBSD_X86_SEGBASES register notes.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index a99149e..37c53cf 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -11027,6 +11027,9 @@ elfcore_grok_freebsd_note (bfd *abfd, Elf_Internal_Note *note)
case NT_FREEBSD_PROCSTAT_AUXV:
return elfcore_make_auxv_note_section (abfd, note, 4);
+ case NT_FREEBSD_X86_SEGBASES:
+ return elfcore_make_note_pseudosection (abfd, ".reg-x86-segbases", note);
+
case NT_X86_XSTATE:
return elfcore_grok_xstatereg (abfd, note);
@@ -11905,6 +11908,15 @@ elfcore_write_xstatereg (bfd *abfd, char *buf, int *bufsiz,
}
char *
+elfcore_write_x86_segbases (bfd *abfd, char *buf, int *bufsiz,
+ const void *regs, int size)
+{
+ char *note_name = "FreeBSD";
+ return elfcore_write_note (abfd, buf, bufsiz,
+ note_name, NT_FREEBSD_X86_SEGBASES, regs, size);
+}
+
+char *
elfcore_write_ppc_vmx (bfd *abfd,
char *buf,
int *bufsiz,
@@ -12441,6 +12453,8 @@ elfcore_write_register_note (bfd *abfd,
return elfcore_write_prxfpreg (abfd, buf, bufsiz, data, size);
if (strcmp (section, ".reg-xstate") == 0)
return elfcore_write_xstatereg (abfd, buf, bufsiz, data, size);
+ if (strcmp (section, ".reg-x86-segbases") == 0)
+ return elfcore_write_x86_segbases (abfd, buf, bufsiz, data, size);
if (strcmp (section, ".reg-ppc-vmx") == 0)
return elfcore_write_ppc_vmx (abfd, buf, bufsiz, data, size);
if (strcmp (section, ".reg-ppc-vsx") == 0)