Ville-Pertti Keinonen wrote: > +++ crt1.c 1999/12/02 09:02:05 > @@ -92,7 +92,17 @@ > monstartup(&eprol, &etext); > #endif > _init(); > - exit( main(argc, argv, env) ); > + asm volatile("andl $~15,%%esp;" > + "addl $4,%%esp;" > + "pushl %2;" > + "pushl %1;" > + "pushl %0;" > + "call main;" > + "movl %%eax,(%%esp);" > + "call exit" > + : : "rm" (argc), "rm" (argv), "rm" (env)); AFAICT, it's enough to just align the stack before doing anything else. In this case it means aligning the stack somewhere before (exit(main(...)). gcc maintains proper alignment on an aligned stack. Maybe alignment can even be done in the kernel... -- Marcel Moolenaar mailto:[EMAIL PROTECTED] SCC Internetworking & Databases http://www.scc.nl/ The FreeBSD project mailto:[EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
- Re: kernel: -mpreferred-st... Marcel Moolenaar
- Re: kernel: -mpreferred-st... Bruce Evans
- Re: kernel: -mpreferred-st... Dmitrij Tejblum
- Re: kernel: -mpreferred-st... Bruce Evans
- Re: kernel: -mpreferred-st... Matthew Dillon
- Re: kernel: -mpreferred-st... Ville-Pertti Keinonen
- Re: kernel: -mpreferred-st... Marcel Moolenaar
- Re: kernel: -mpreferred-st... Ville-Pertti Keinonen
- Re: kernel: -mpreferred-stack-boundary=2 ?? Ville-Pertti Keinonen
- Re: kernel: -mpreferred-stack-boundary=2 ?? Ville-Pertti Keinonen
- Re: kernel: -mpreferred-stack-boundary=2 ?? Marcel Moolenaar
- Re: kernel: -mpreferred-stack-boundary=2 ?? Ville-Pertti Keinonen
- Re: kernel: -mpreferred-stack-boundary=... Marcel Moolenaar
- Re: kernel: -mpreferred-stack-bound... Ville-Pertti Keinonen
- Re: kernel: -mpreferred-stack-boundary=2 ?? Bruce Evans
- Re: kernel: -mpreferred-stack-boundary=2 ?? Ville-Pertti Keinonen
- Re: kernel: -mpreferred-stack-boundary=... Marcel Moolenaar
- Re: kernel: -mpreferred-stack-boundary=... Bruce Evans