From bc989cdc1ce4e96e07fcc668742251f3315365ec Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 10 May 2011 06:13:07 +0000 Subject: [PATCH] bfd/ * elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and 32bit psinfo. * elf32-ppc.c (ppc_elf_grok_psinfo): Initialize core_pid. * elf64-ppc.c (ppc64_elf_grok_psinfo): Likewise. --- bfd/ChangeLog | 7 +++++++ bfd/elf.c | 2 ++ bfd/elf32-ppc.c | 2 ++ bfd/elf64-ppc.c | 2 ++ 4 files changed, 13 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0687337a2e6..526dd83b882 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2011-05-10 Jan Kratochvil + + * elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and + 32bit psinfo. + * elf32-ppc.c (ppc_elf_grok_psinfo): Initialize core_pid. + * elf64-ppc.c (ppc64_elf_grok_psinfo): Likewise. + 2011-05-09 Paul Brook * bfd-in.h (elf32_tic6x_fix_exidx_coverage): Add prototype. diff --git a/bfd/elf.c b/bfd/elf.c index 6fccf429343..966ada024b1 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -8000,6 +8000,7 @@ elfcore_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) memcpy (&psinfo, note->descdata, sizeof (psinfo)); + elf_tdata (abfd)->core_pid = psinfo.pr_pid; elf_tdata (abfd)->core_program = _bfd_elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); @@ -8016,6 +8017,7 @@ elfcore_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) memcpy (&psinfo, note->descdata, sizeof (psinfo)); + elf_tdata (abfd)->core_pid = psinfo.pr_pid; elf_tdata (abfd)->core_program = _bfd_elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index c7363753d49..42d9b46120b 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1881,6 +1881,8 @@ ppc_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) return FALSE; case 128: /* Linux/PPC 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 diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 543a7272b28..1394ff544e4 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -2670,6 +2670,8 @@ ppc64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) if (note->descsz != 136) return FALSE; + 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 -- 2.30.2