Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2002 12:34:30 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 18599 for review
Message-ID:  <200210031934.g93JYUZ6002704@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18599

Change 18599 by peter@peter_daintree on 2002/10/03 12:34:07

	just call exit(main()) rather than doing asm for now.
	I think gcc does a 'good enough' job.  But just in case,
	take a shot at updating the asm code.

Affected files ...

.. //depot/projects/hammer/lib/csu/x86_64/crt1.c#4 edit

Differences ...

==== //depot/projects/hammer/lib/csu/x86_64/crt1.c#4 (text+ko) ====

@@ -100,7 +100,7 @@
 	monstartup(&eprol, &etext);
 #endif
 	_init();
-#ifndef __GNUC__
+#ifndef __GNUC__dont_care_yet
 	exit( main(argc, argv, env) );
 #else
 	/*
@@ -124,15 +124,12 @@
 	 * of compiling main() with -fomit-frame-pointer.
 	 */
 	__asm__("
-	andl	$~0xf, %%esp		# align stack to 16-byte boundary
-	subl	$12+12, %%esp		# space for args and padding
-	movl	%0, 0(%%esp)
-	movl	%1, 4(%%esp)
-	movl	%2, 8(%%esp)
+	andl	$~0xf, %%rsp		# align stack to 16-byte boundary
+	subq	$8, %%rsp		# align after return address
 	call	main
-	movl	%%eax, 0(%%esp)
+	movl	%%eax, %%edi
 	call	exit
-	" : : "r" (argc), "r" (argv), "r" (env) : "ax", "cx", "dx", "memory");
+	" : : "D" (argc), "S" (argv), "d" (env) : "ax", "dx", "si", "di", "memory");
 #endif
 }
 

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?200210031934.g93JYUZ6002704>