|
From: Julian S. <js...@ac...> - 2005-08-26 17:18:52
|
> I think you need -nostartfiles as well.
If I add that, then it complains about a lack of "_start" but nothing
else.
So I added this to m_main.c:
//extern char _start[];
extern Int main (Int argc, HChar **argv, HChar **envp);
Int _start (Int argc, HChar **argv, HChar **envp)
{
return main(argc,argv,envp);
}
and it links. So I get a warm fuzzy feeling.
However, it segfaults at startup. Stepping through with GDB, it dies
when looking for auxv on the stack. And the args to main are obviously
bogus:
main (argc=-1073745111, argv=0x0, envp=0xbffff364) at m_main.c:2352
So I guess my crude scheme of calling main from _start ain't going to
work.
Now what? Should _start do some futzing around with the
initial stack that the kernel builds, so as to get a correct
argc/v/envp ?
J
|