diff options
Diffstat (limited to 'arch/mips/kernel/irixelf.c')
-rw-r--r-- | arch/mips/kernel/irixelf.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c index 35055ac68..47947bbf0 100644 --- a/arch/mips/kernel/irixelf.c +++ b/arch/mips/kernel/irixelf.c @@ -1,4 +1,4 @@ -/* $Id: irixelf.c,v 1.26 2000/03/07 15:45:28 ralf Exp $ +/* $Id: irixelf.c,v 1.27 2000/03/19 01:28:43 ralf Exp $ * * irixelf.c: Code to load IRIX ELF executables which conform to * the MIPS ABI. @@ -43,7 +43,7 @@ #undef DEBUG_ELF static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs); -static int load_irix_library(int fd); +static int load_irix_library(struct file *); static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file); extern int dump_fpu (elf_fpregset_t *); @@ -829,7 +829,7 @@ out_free_ph: /* This is really simpleminded and specialized - we are loading an * a.out library that is given an ELF header. */ -static inline int do_load_irix_library(struct file *file) +static int load_irix_library(struct file *file) { struct elfhdr elf_ex; struct elf_phdr *elf_phdata = NULL; @@ -843,8 +843,6 @@ static inline int do_load_irix_library(struct file *file) int i,j, k; len = 0; - if (!file->f_op) - return -EACCES; dentry = file->f_dentry; inode = dentry->d_inode; elf_bss = 0; @@ -897,16 +895,18 @@ static inline int do_load_irix_library(struct file *file) while(elf_phdata->p_type != PT_LOAD) elf_phdata++; /* Now use mmap to map the library into memory. */ + down(¤t->mm->mmap_sem); error = do_mmap(file, elf_phdata->p_vaddr & 0xfffff000, elf_phdata->p_filesz + (elf_phdata->p_vaddr & 0xfff), PROT_READ | PROT_WRITE | PROT_EXEC, MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE, elf_phdata->p_offset & 0xfffff000); + up(¤t->mm->mmap_sem); k = elf_phdata->p_vaddr + elf_phdata->p_filesz; - if(k > elf_bss) elf_bss = k; - + if (k > elf_bss) elf_bss = k; + if (error != (elf_phdata->p_vaddr & 0xfffff000)) { kfree(elf_phdata); return error; @@ -921,19 +921,6 @@ static inline int do_load_irix_library(struct file *file) kfree(elf_phdata); return 0; } - -static int load_irix_library(int fd) -{ - int retval = -EACCES; - struct file *file; - - file = fget(fd); - if (file) { - retval = do_load_irix_library(file); - fput(file); - } - return retval; -} /* Called through irix_syssgi() to map an elf image given an FD, * a phdr ptr USER_PHDRP in userspace, and a count CNT telling how many |