From 544c67cda1686c1b204cb96c0d7885b08d37b8d6 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 6 Oct 2017 11:41:45 -0700 Subject: Account for padding in FreeBSD/mipsn32 NT_PRSTATUS notes. Add a new ELF backend method to grok FreeBSD NT_PRSTATUS core dump notes. Define a method for MIPS N32 to override the default elfcore_grok_freebsd_prstatus that accounts for additional padding between pr_pid and pr_reg that is not present in other 32-bit FreeBSD platforms. * elf-bfd.h (struct elf_backend_data): Add `elf_backend_grok_freebsd_prstatus'. * elf.c (elfcore_grok_freebsd_note): Call `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if present. * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New function. (elf_backend_grok_freebsd_prstatus): Define. * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define. (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'. --- bfd/elf.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bfd/elf.c') diff --git a/bfd/elf.c b/bfd/elf.c index 02decea..c6de70d 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -9981,9 +9981,14 @@ elfcore_grok_freebsd_prstatus (bfd *abfd, Elf_Internal_Note *note) static bfd_boolean elfcore_grok_freebsd_note (bfd *abfd, Elf_Internal_Note *note) { + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + switch (note->type) { case NT_PRSTATUS: + if (bed->elf_backend_grok_freebsd_prstatus) + if ((*bed->elf_backend_grok_freebsd_prstatus) (abfd, note)) + return TRUE; return elfcore_grok_freebsd_prstatus (abfd, note); case NT_FPREGSET: -- cgit v1.1