diff options
Diffstat (limited to 'fs/binfmt_elf.c')
| -rw-r--r-- | fs/binfmt_elf.c | 20 | 
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 0c42cdbabec..3939829f6c5 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> @@ -321,6 +322,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,  	return 0;  } +#ifndef elf_map +  static unsigned long elf_map(struct file *filep, unsigned long addr,  		struct elf_phdr *eppnt, int prot, int type,  		unsigned long total_size) @@ -355,6 +358,8 @@ static unsigned long elf_map(struct file *filep, unsigned long addr,  	return(map_addr);  } +#endif /* !elf_map */ +  static unsigned long total_mapping_size(struct elf_phdr *cmds, int nr)  {  	int i, first_idx = -1, last_idx = -1; @@ -1140,7 +1145,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,  	/* By default, dump shared memory if mapped from an anonymous file. */  	if (vma->vm_flags & VM_SHARED) { -		if (vma->vm_file->f_path.dentry->d_inode->i_nlink == 0 ? +		if (file_inode(vma->vm_file)->i_nlink == 0 ?  		    FILTER(ANON_SHARED) : FILTER(MAPPED_SHARED))  			goto whole;  		return 0; @@ -1248,7 +1253,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 +1325,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 +1638,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 +1878,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  |