Lines Matching refs:params
123 static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params, in elf_fdpic_fetch_phdrs() argument
130 if (params->hdr.e_phentsize != sizeof(struct elf_phdr)) in elf_fdpic_fetch_phdrs()
132 if (params->hdr.e_phnum > 65536U / sizeof(struct elf_phdr)) in elf_fdpic_fetch_phdrs()
135 size = params->hdr.e_phnum * sizeof(struct elf_phdr); in elf_fdpic_fetch_phdrs()
136 params->phdrs = kmalloc(size, GFP_KERNEL); in elf_fdpic_fetch_phdrs()
137 if (!params->phdrs) in elf_fdpic_fetch_phdrs()
140 retval = kernel_read(file, params->hdr.e_phoff, in elf_fdpic_fetch_phdrs()
141 (char *) params->phdrs, size); in elf_fdpic_fetch_phdrs()
146 phdr = params->phdrs; in elf_fdpic_fetch_phdrs()
147 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_fetch_phdrs()
152 params->flags |= ELF_FDPIC_FLAG_EXEC_STACK; in elf_fdpic_fetch_phdrs()
154 params->flags |= ELF_FDPIC_FLAG_NOEXEC_STACK; in elf_fdpic_fetch_phdrs()
156 params->stack_size = phdr->p_memsz; in elf_fdpic_fetch_phdrs()
738 static int elf_fdpic_map_file(struct elf_fdpic_params *params, in elf_fdpic_map_file() argument
756 for (loop = 0; loop < params->hdr.e_phnum; loop++) in elf_fdpic_map_file()
757 if (params->phdrs[loop].p_type == PT_LOAD) in elf_fdpic_map_file()
768 params->loadmap = loadmap; in elf_fdpic_map_file()
773 load_addr = params->load_addr; in elf_fdpic_map_file()
777 switch (params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) { in elf_fdpic_map_file()
781 ret = elf_fdpic_map_file_constdisp_on_uclinux(params, file, mm); in elf_fdpic_map_file()
787 ret = elf_fdpic_map_file_by_direct_mmap(params, file, mm); in elf_fdpic_map_file()
794 if (params->hdr.e_entry) { in elf_fdpic_map_file()
797 if (params->hdr.e_entry >= seg->p_vaddr && in elf_fdpic_map_file()
798 params->hdr.e_entry < seg->p_vaddr + seg->p_memsz) { in elf_fdpic_map_file()
799 params->entry_addr = in elf_fdpic_map_file()
800 (params->hdr.e_entry - seg->p_vaddr) + in elf_fdpic_map_file()
808 stop = params->hdr.e_phoff; in elf_fdpic_map_file()
809 stop += params->hdr.e_phnum * sizeof (struct elf_phdr); in elf_fdpic_map_file()
810 phdr = params->phdrs; in elf_fdpic_map_file()
812 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file()
816 if (phdr->p_offset > params->hdr.e_phoff || in elf_fdpic_map_file()
825 params->ph_addr = in elf_fdpic_map_file()
828 params->hdr.e_phoff - phdr->p_offset; in elf_fdpic_map_file()
836 phdr = params->phdrs; in elf_fdpic_map_file()
837 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file()
846 params->dynamic_addr = in elf_fdpic_map_file()
859 params->dynamic_addr)[tmp - 1].d_tag != 0) in elf_fdpic_map_file()
897 kdebug("- elfhdr : %lx", params->elfhdr_addr); in elf_fdpic_map_file()
898 kdebug("- entry : %lx", params->entry_addr); in elf_fdpic_map_file()
899 kdebug("- PHDR[] : %lx", params->ph_addr); in elf_fdpic_map_file()
900 kdebug("- DYNAMIC[]: %lx", params->dynamic_addr); in elf_fdpic_map_file()
922 struct elf_fdpic_params *params, in elf_fdpic_map_file_constdisp_on_uclinux() argument
931 load_addr = params->load_addr; in elf_fdpic_map_file_constdisp_on_uclinux()
932 seg = params->loadmap->segs; in elf_fdpic_map_file_constdisp_on_uclinux()
936 phdr = params->phdrs; in elf_fdpic_map_file_constdisp_on_uclinux()
937 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file_constdisp_on_uclinux()
938 if (params->phdrs[loop].p_type != PT_LOAD) in elf_fdpic_map_file_constdisp_on_uclinux()
949 if (params->flags & ELF_FDPIC_FLAG_EXECUTABLE) in elf_fdpic_map_file_constdisp_on_uclinux()
961 phdr = params->phdrs; in elf_fdpic_map_file_constdisp_on_uclinux()
962 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file_constdisp_on_uclinux()
963 if (params->phdrs[loop].p_type != PT_LOAD) in elf_fdpic_map_file_constdisp_on_uclinux()
977 params->elfhdr_addr = seg->addr; in elf_fdpic_map_file_constdisp_on_uclinux()
1010 static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params, in elf_fdpic_map_file_by_direct_mmap() argument
1019 load_addr = params->load_addr; in elf_fdpic_map_file_by_direct_mmap()
1023 seg = params->loadmap->segs; in elf_fdpic_map_file_by_direct_mmap()
1026 phdr = params->phdrs; in elf_fdpic_map_file_by_direct_mmap()
1027 for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) { in elf_fdpic_map_file_by_direct_mmap()
1046 if (params->flags & ELF_FDPIC_FLAG_EXECUTABLE) in elf_fdpic_map_file_by_direct_mmap()
1051 switch (params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) { in elf_fdpic_map_file_by_direct_mmap()
1099 if ((params->flags & ELF_FDPIC_FLAG_ARRANGEMENT) == in elf_fdpic_map_file_by_direct_mmap()
1109 params->elfhdr_addr = seg->addr; in elf_fdpic_map_file_by_direct_mmap()