On MIPS o32, n32 and n64 platforms, PID information was not
correctly propagated from core dump file to internal GDB
structures. This patch fixes that behavior.
A correct PID is needed by `libthread_db' library supplied with
glibc repository revisions before commit
c579f48edba8 ("Remove
cached PID/TID in clone") or released versions before 2.25 for
GDB to fetch value of TLS variable from core file.
bfd/ChangeLog:
* elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
* elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
* elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
+2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
+
+ * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
+ * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
+ * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
+
2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
* elf32-mips.c (elf32_mips_write_core_note): New function.
return FALSE;
case 128: /* Linux/MIPS elf_prpsinfo */
+ elf_tdata (abfd)->core->pid
+ = bfd_get_32 (abfd, note->descdata + 16);
elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
elf_tdata (abfd)->core->command
return FALSE;
case 136: /* Linux/MIPS - N64 kernel elf_prpsinfo */
+ elf_tdata (abfd)->core->pid
+ = bfd_get_32 (abfd, note->descdata + 24);
elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
elf_tdata (abfd)->core->command
return FALSE;
case 128: /* Linux/MIPS elf_prpsinfo */
+ elf_tdata (abfd)->core->pid
+ = bfd_get_32 (abfd, note->descdata + 16);
elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
elf_tdata (abfd)->core->command