diff options
author | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2017-11-08 21:19:05 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@mips.com> | 2017-11-08 21:19:05 +0000 |
commit | c9ec0e8945d057979a361e3545d42b3f15adf04a (patch) | |
tree | 732d9773b220e43ee35c449d5b2434e4a7ffad11 /bfd/elf64-mips.c | |
parent | BFD: Write Linux core PRSTATUS note into MIPS core file (diff) | |
download | binutils-gdb-c9ec0e8945d057979a361e3545d42b3f15adf04a.tar.gz binutils-gdb-c9ec0e8945d057979a361e3545d42b3f15adf04a.tar.bz2 binutils-gdb-c9ec0e8945d057979a361e3545d42b3f15adf04a.zip |
BFD: Extract PID from MIPS core dump file
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.
Diffstat (limited to 'bfd/elf64-mips.c')
-rw-r--r-- | bfd/elf64-mips.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index af0c01c5410..291a8a9370f 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -4228,6 +4228,8 @@ elf64_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) 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 |