Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2002 00:03:28 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 13145 for review
Message-ID:  <200206190703.g5J73S510534@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206190703.g5J73S510534>