PERFORCE change 29554 for review
Peter Wemm
peter at FreeBSD.org
Wed Apr 23 15:28:13 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=29554
Change 29554 by peter at 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];
More information about the p4-projects
mailing list