• Home
  • Raw
  • Download

Lines Matching refs:params

138 static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params,  in elf_fdpic_fetch_phdrs()  argument
144 loff_t pos = params->hdr.e_phoff; in elf_fdpic_fetch_phdrs()
146 if (params->hdr.e_phentsize != sizeof(struct elf_phdr)) in elf_fdpic_fetch_phdrs()
148 if (params->hdr.e_phnum > 65536U / sizeof(struct elf_phdr)) in elf_fdpic_fetch_phdrs()
151 size = params->hdr.e_phnum * sizeof(struct elf_phdr); in elf_fdpic_fetch_phdrs()
152 params->phdrs = kmalloc(size, GFP_KERNEL); in elf_fdpic_fetch_phdrs()
153 if (!params->phdrs) in elf_fdpic_fetch_phdrs()
156 retval = kernel_read(file, params->phdrs, size, &pos); in elf_fdpic_fetch_phdrs()
161 phdr = params->phdrs; in elf_fdpic_fetch_phdrs()
162 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_fetch_phdrs()
167 params->flags |= ELF_FDPIC_FLAG_EXEC_STACK; in elf_fdpic_fetch_phdrs()
169 params->flags |= ELF_FDPIC_FLAG_NOEXEC_STACK; in elf_fdpic_fetch_phdrs()
171 params->stack_size = phdr->p_memsz; in elf_fdpic_fetch_phdrs()
728 static int elf_fdpic_map_file(struct elf_fdpic_params *params, in elf_fdpic_map_file() argument
746 for (loop = 0; loop < params->hdr.e_phnum; loop++) in elf_fdpic_map_file()
747 if (params->phdrs[loop].p_type == PT_LOAD) in elf_fdpic_map_file()
758 params->loadmap = loadmap; in elf_fdpic_map_file()
763 load_addr = params->load_addr; in elf_fdpic_map_file()
767 switch (params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) { in elf_fdpic_map_file()
771 ret = elf_fdpic_map_file_constdisp_on_uclinux(params, file, mm); in elf_fdpic_map_file()
777 ret = elf_fdpic_map_file_by_direct_mmap(params, file, mm); in elf_fdpic_map_file()
784 if (params->hdr.e_entry) { in elf_fdpic_map_file()
787 if (params->hdr.e_entry >= seg->p_vaddr && in elf_fdpic_map_file()
788 params->hdr.e_entry < seg->p_vaddr + seg->p_memsz) { in elf_fdpic_map_file()
789 params->entry_addr = in elf_fdpic_map_file()
790 (params->hdr.e_entry - seg->p_vaddr) + in elf_fdpic_map_file()
798 stop = params->hdr.e_phoff; in elf_fdpic_map_file()
799 stop += params->hdr.e_phnum * sizeof (struct elf_phdr); in elf_fdpic_map_file()
800 phdr = params->phdrs; in elf_fdpic_map_file()
802 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file()
806 if (phdr->p_offset > params->hdr.e_phoff || in elf_fdpic_map_file()
815 params->ph_addr = in elf_fdpic_map_file()
818 params->hdr.e_phoff - phdr->p_offset; in elf_fdpic_map_file()
826 phdr = params->phdrs; in elf_fdpic_map_file()
827 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file()
839 params->dynamic_addr = in elf_fdpic_map_file()
851 dyn = (Elf32_Dyn __user *)params->dynamic_addr; in elf_fdpic_map_file()
891 kdebug("- elfhdr : %lx", params->elfhdr_addr); in elf_fdpic_map_file()
892 kdebug("- entry : %lx", params->entry_addr); in elf_fdpic_map_file()
893 kdebug("- PHDR[] : %lx", params->ph_addr); in elf_fdpic_map_file()
894 kdebug("- DYNAMIC[]: %lx", params->dynamic_addr); in elf_fdpic_map_file()
916 struct elf_fdpic_params *params, in elf_fdpic_map_file_constdisp_on_uclinux() argument
925 load_addr = params->load_addr; in elf_fdpic_map_file_constdisp_on_uclinux()
926 seg = params->loadmap->segs; in elf_fdpic_map_file_constdisp_on_uclinux()
930 phdr = params->phdrs; in elf_fdpic_map_file_constdisp_on_uclinux()
931 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file_constdisp_on_uclinux()
932 if (params->phdrs[loop].p_type != PT_LOAD) in elf_fdpic_map_file_constdisp_on_uclinux()
943 if (params->flags & ELF_FDPIC_FLAG_EXECUTABLE) in elf_fdpic_map_file_constdisp_on_uclinux()
955 phdr = params->phdrs; in elf_fdpic_map_file_constdisp_on_uclinux()
956 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file_constdisp_on_uclinux()
957 if (params->phdrs[loop].p_type != PT_LOAD) in elf_fdpic_map_file_constdisp_on_uclinux()
971 params->elfhdr_addr = seg->addr; in elf_fdpic_map_file_constdisp_on_uclinux()
1004 static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params, in elf_fdpic_map_file_by_direct_mmap() argument
1013 load_addr = params->load_addr; in elf_fdpic_map_file_by_direct_mmap()
1017 seg = params->loadmap->segs; in elf_fdpic_map_file_by_direct_mmap()
1020 phdr = params->phdrs; in elf_fdpic_map_file_by_direct_mmap()
1021 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file_by_direct_mmap()
1040 if (params->flags & ELF_FDPIC_FLAG_EXECUTABLE) in elf_fdpic_map_file_by_direct_mmap()
1045 switch (params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) { in elf_fdpic_map_file_by_direct_mmap()
1093 if ((params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) == in elf_fdpic_map_file_by_direct_mmap()
1103 params->elfhdr_addr = seg->addr; in elf_fdpic_map_file_by_direct_mmap()