[parisc-linux-cvs] binfmt_elf cleanup
Matthew Wilcox
willy@debian.org
Thu, 4 Oct 2001 14:14:04 +0100
this was the -pa27 commit.
Index: fs/binfmt_elf.c
===================================================================
RCS file: /home/cvs/parisc/linux/fs/binfmt_elf.c,v
retrieving revision 1.21
diff -u -p -r1.21 binfmt_elf.c
--- binfmt_elf.c 2001/08/17 20:08:54 1.21
+++ binfmt_elf.c 2001/09/28 09:02:37
@@ -105,13 +105,13 @@ static void padzero(unsigned long elf_bs
#ifdef ARCH_STACK_GROWSUP
#define STACK_ADD(sp, items) ((elf_addr_t *)(sp) + (items))
#define STACK_ROUND(sp, items) \
- (void *)((15 + (unsigned long) ((sp) + (items))) &~ 15UL)
-#define STACK_ALLOC(sp, len) ({ void *old_sp = sp; (char *)sp += len; old_sp; })
+ ((15 + (unsigned long) ((sp) + (items))) &~ 15UL)
+#define STACK_ALLOC(sp, len) ({ elf_addr_t old_sp = sp; sp += len; old_sp; })
#else
#define STACK_ADD(sp, items) ((elf_addr_t *)(sp) - (items))
#define STACK_ROUND(sp, items) \
- (void *)(((unsigned long) (sp - items)) &~ 15UL)
-#define STACK_ALLOC(sp, len) ({ (char *)sp -= len; sp; })
+ (((unsigned long) (sp - items)) &~ 15UL)
+#define STACK_ALLOC(sp, len) sp -= len
#endif
static void
@@ -141,7 +141,7 @@ create_elf_tables(struct linux_binprm *b
if (k_platform) {
size_t len = strlen(k_platform) + 1;
u_platform = STACK_ALLOC(bprm->p, len);
- __copy_to_user(u_platform, k_platform, len);
+ __copy_to_user((void *)u_platform, k_platform, len);
}
/* Create the ELF interpreter info */
@@ -188,12 +188,12 @@ create_elf_tables(struct linux_binprm *b
} else {
items += 1; /* ELF interpreters only put argc on the stack */
}
- bprm->p = (unsigned long) STACK_ROUND(sp, items);
+ bprm->p = STACK_ROUND(sp, items);
/* Point sp at the lowest address on the stack */
#ifdef ARCH_STACK_GROWSUP
sp = (elf_addr_t *)bprm->p - items - ei_index;
- bprm->exec = sp; /* XXX: PARISC HACK */
+ bprm->exec = (unsigned long) sp; /* XXX: PARISC HACK */
#else
sp = (elf_addr_t *)bprm->p;
#endif
Index: include/asm-parisc/processor.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/processor.h,v
retrieving revision 1.46
diff -u -p -r1.46 processor.h
--- processor.h 2001/09/06 09:44:12 1.46
+++ processor.h 2001/09/28 09:02:37
@@ -275,7 +275,7 @@ on downward growing arches, it looks lik
regs->gr[31] = pc; \
\
get_user(regs->gr[25], (argv - 1)); \
- regs->gr[24] = argv; \
+ regs->gr[24] = (long) argv; \
regs->gr[23] = 0; \
} while(0)
--
Revolutions do not require corporate support.