Date: Wed, 23 Apr 2003 15:28:10 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 29554 for review Message-ID: <200304232228.h3NMSAli029826@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=29554 Change 29554 by peter@peter_daintree on 2003/04/23 15:27:40 update for x86-64 calling conventions. This is not ABI compliant yet, but with a corresponding commit to exec_setregs(), it reaches basic functionality Affected files ... .. //depot/projects/hammer/lib/csu/x86_64/crt1.c#7 edit Differences ... ==== //depot/projects/hammer/lib/csu/x86_64/crt1.c#7 (text+ko) ==== @@ -43,7 +43,7 @@ extern void _fini(void); extern void _init(void); extern int main(int, char **, char **); -extern void _start(char *, ...); +extern void _start(char **, void (*)(void)); #ifdef GCRT extern void _mcleanup(void); @@ -55,33 +55,18 @@ char **environ; const char *__progname = ""; -static __inline fptr -get_rtld_cleanup(void) -{ - fptr retval; - -#ifdef __GNUC__ - __asm__("movq %%rdx,%0" : "=rm"(retval)); -#else - retval = (fptr)0; /* XXXX Fix this for other compilers */ -#endif - return(retval); -} - /* The entry function. */ void -_start(char *ap, ...) +_start(char **ap, void (*cleanup)(void)) { - fptr cleanup; int argc; char **argv; char **env; const char *s; - cleanup = get_rtld_cleanup(); - argv = ≈ - argc = *(long *)(void *)(argv - 1); - env = argv + argc + 1; + argc = *(long *)(void *)ap; + argv = ap + 1; + env = ap + 2 + argc; environ = env; if (argc > 0 && argv[0] != NULL) { __progname = argv[0];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304232228.h3NMSAli029826>