rk312x: add psci support
[firefly-linux-kernel-4.4.55.git] / fs / binfmt_elf_fdpic.c
index 9c13e023e2b72368004bad13033a7709ee5c62a6..c166f325a1839b1ecf83ae0b068f13e8a26495c2 100644 (file)
@@ -483,7 +483,6 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
        size_t platform_len = 0, len;
        char *k_platform, *k_base_platform;
        char __user *u_platform, *u_base_platform, *p;
-       long hwcap;
        int loop;
        int nr; /* reset for each csp adjustment */
 
@@ -502,8 +501,6 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
                return -EFAULT;
 #endif
 
-       hwcap = ELF_HWCAP;
-
        /*
         * If this architecture has a platform capability string, copy it
         * to userspace.  In some cases (Sparc), this info is impossible
@@ -617,7 +614,10 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
 
        nr = 0;
        csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long);
-       NEW_AUX_ENT(AT_HWCAP,   hwcap);
+       NEW_AUX_ENT(AT_HWCAP,   ELF_HWCAP);
+#ifdef ELF_HWCAP2
+       NEW_AUX_ENT(AT_HWCAP2,  ELF_HWCAP2);
+#endif
        NEW_AUX_ENT(AT_PAGESZ,  PAGE_SIZE);
        NEW_AUX_ENT(AT_CLKTCK,  CLOCKS_PER_SEC);
        NEW_AUX_ENT(AT_PHDR,    exec_params->ph_addr);
@@ -926,7 +926,6 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(
        struct elf32_fdpic_loadseg *seg;
        struct elf32_phdr *phdr;
        unsigned long load_addr, base = ULONG_MAX, top = 0, maddr = 0, mflags;
-       loff_t fpos;
        int loop, ret;
 
        load_addr = params->load_addr;
@@ -964,14 +963,12 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(
                if (params->phdrs[loop].p_type != PT_LOAD)
                        continue;
 
-               fpos = phdr->p_offset;
-
                seg->addr = maddr + (phdr->p_vaddr - base);
                seg->p_vaddr = phdr->p_vaddr;
                seg->p_memsz = phdr->p_memsz;
 
-               ret = file->f_op->read(file, (void *) seg->addr,
-                                      phdr->p_filesz, &fpos);
+               ret = read_code(file, seg->addr, phdr->p_offset,
+                                      phdr->p_filesz);
                if (ret < 0)
                        return ret;
 
@@ -1687,8 +1684,6 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
        fill_elf_fdpic_header(elf, e_phnum);
 
        has_dumped = 1;
-       current->flags |= PF_DUMPCORE;
-
        /*
         * Set up the notes in similar form to SVR4 core dumps made
         * with info from their /proc.