|
From: Tom H. <th...@cy...> - 2003-09-25 08:57:17
|
In message <Pin...@gr...>
Nicholas Nethercote <nj...@ca...> wrote:
> I then linked them with the object file of a test program, null.o:
>
> ld -Lmemcheck -lmemcheck -Lcoregrind -lvalgrind null.o
>
> ld warned:
>
> ld: warning: cannot find entry symbol _start; defaulting to 08048074
You linked using the linker itself without linking in the C library
or the run time startup code, which is where _start will live. That
will then call main after firing up the C library.
Unless you've got a very good reason to do otherwise you're usually
better off linking with cc as that will automatically the C library
and run time startup code to the link. Try this:
cc -Lmemcheck -lmemcheck -Lcoregrind -lvalgrind null.o
If you add -v to that then you'll see all the extra things that cc
throws into the link which you were missing...
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|