]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/binfmt_elf.c
Merge tag 'metag-v3.9-rc1-v4' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan...
[karo-tx-linux.git] / fs / binfmt_elf.c
index cfc22c9d75bc0e468156002cafaf950955ee67db..3939829f6c5cc67e7d0ca1e9518f1df834be5088 100644 (file)
@@ -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>
@@ -1144,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;
@@ -1252,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));
 
@@ -1324,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);
@@ -1634,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.
@@ -1874,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