|
From: Tom H. <to...@co...> - 2005-08-26 18:29:24
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
>
> > Alternatively, you could link with -nostartfiles, which will omit
> > crt1.o completely. In that case you need your own start.S that
> > provides a _start() function that processes auxv and calls Valgrind's
> > main().
>
> Did that. It seems to work. Cool. Just committed revs 1363 and 4526.
So I see. I was just about to post my version which does it all
in assembly:
asm("\t.globl _start\n"
"\t.type _start,@function\n"
"_start:\n"
"\tpopl %esi\n"
"\tmovl %esp, %ecx\n"
"\tand $0xfffffff0, %esp\n"
"\tmovl %esi, %eax\n"
"\tincl %eax\n"
"\tshl $2, %eax\n"
"\taddl %ecx, %eax\n"
"\tpushl %eax\n"
"\tpushl %ecx\n"
"\tpushl %esi\n"
"\tcall main\n"
"\tmov %eax, %ebx\n"
"\tmov $1, %eax\n"
"\tint $0x80\n"
"\thlt\n");
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|