From owner-p4-projects Wed Jun 19 0: 3:37 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0475237B40F; Wed, 19 Jun 2002 00:03:30 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D08CF37B40E for ; Wed, 19 Jun 2002 00:03:28 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5J73S510534 for perforce@freebsd.org; Wed, 19 Jun 2002 00:03:28 -0700 (PDT) (envelope-from peter@freebsd.org) Date: Wed, 19 Jun 2002 00:03:28 -0700 (PDT) Message-Id: <200206190703.g5J73S510534@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 13145 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=13145 Change 13145 by peter@peter_ia64 on 2002/06/19 00:02:56 Fix up the mess that was made of the arguments being passed to the elf executable. This makes dynamic binaries work again, and stops static binaries sometimes being unable to find their args and environment. I do not know why this suddenly broke, but it broke completely for me at the last integ. It was always broken though. The fix was to use target-specific types for the stack size so that we didn't decrement the stack by 64 bits on the 32 bit elf targets and didn't space the ELF AT_* args by 64 bits as well. Affected files ... ... //depot/projects/ia64/sys/kern/imgact_elf.c#9 edit Differences ... ==== //depot/projects/ia64/sys/kern/imgact_elf.c#9 (text+ko) ==== @@ -832,17 +832,21 @@ #if __ELF_WORD_SIZE == 32 #define suword suword32 +#define stacktype u_int32_t #else #define suword suword64 +#define stacktype u_int64_t #endif int __elfN(freebsd_fixup)(register_t **stack_base, struct image_params *imgp) { Elf_Auxargs *args = (Elf_Auxargs *)imgp->auxargs; - register_t *pos; + stacktype *base; + stacktype *pos; - pos = *stack_base + (imgp->argc + imgp->envc + 2); + base = (stacktype *)*stack_base; + pos = base + (imgp->argc + imgp->envc + 2); if (args->trace) { AUXARGS_ENTRY(pos, AT_DEBUG, 1); @@ -862,8 +866,9 @@ free(imgp->auxargs, M_TEMP); imgp->auxargs = NULL; - (*stack_base)--; - suword(*stack_base, (long) imgp->argc); + base--; + suword(base, (long) imgp->argc); + *stack_base = (register_t *)base; return 0; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message