diff options
Diffstat (limited to 'fs/binfmt_elf.c')
| -rw-r--r-- | fs/binfmt_elf.c | 14 | 
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 11e078a747a..a5702d74d2b 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -33,6 +33,7 @@  #include <linux/elf.h>  #include <linux/utsname.h>  #include <linux/coredump.h> +#include <linux/sched.h>  #include <asm/uaccess.h>  #include <asm/param.h>  #include <asm/page.h> @@ -1248,7 +1249,7 @@ static int writenote(struct memelfnote *men, struct file *file,  #undef DUMP_WRITE  static void fill_elf_header(struct elfhdr *elf, int segs, -			    u16 machine, u32 flags, u8 osabi) +			    u16 machine, u32 flags)  {  	memset(elf, 0, sizeof(*elf)); @@ -1320,8 +1321,11 @@ static void fill_prstatus(struct elf_prstatus *prstatus,  		cputime_to_timeval(cputime.utime, &prstatus->pr_utime);  		cputime_to_timeval(cputime.stime, &prstatus->pr_stime);  	} else { -		cputime_to_timeval(p->utime, &prstatus->pr_utime); -		cputime_to_timeval(p->stime, &prstatus->pr_stime); +		cputime_t utime, stime; + +		task_cputime(p, &utime, &stime); +		cputime_to_timeval(utime, &prstatus->pr_utime); +		cputime_to_timeval(stime, &prstatus->pr_stime);  	}  	cputime_to_timeval(p->signal->cutime, &prstatus->pr_cutime);  	cputime_to_timeval(p->signal->cstime, &prstatus->pr_cstime); @@ -1630,7 +1634,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,  	 * Initialize the ELF file header.  	 */  	fill_elf_header(elf, phdrs, -			view->e_machine, view->e_flags, view->ei_osabi); +			view->e_machine, view->e_flags);  	/*  	 * Allocate a structure for each thread. @@ -1870,7 +1874,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,  	elf_core_copy_regs(&info->prstatus->pr_reg, regs);  	/* Set up header */ -	fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS, ELF_OSABI); +	fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS);  	/*  	 * Set up the notes in similar form to SVR4 core dumps made  |