|
From: Nicholas N. <nj...@ca...> - 2003-09-25 09:15:13
|
On Thu, 25 Sep 2003, Tom Hughes wrote: > 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 Ah, thanks. It now compiles and runs, but Valgrind doesn't get invoked. I guess it's because the .init section in coregrind/vg_startup.S doesn't get called. Normally the "-z initfirst" flag is given to the linker when building valgrind.so... any suggestions how/when to use it when building libvalgrind.a? Can it even be done? Or is there another reason why Valgrind isn't being invoked? [If anyone manages to do this static linking, please post your instructions, that will save me stumbling along, asking questions at every step :] N ps: my list of what-I-did in my last email wasn't quite right -- some of the filenames I changed. the -lmemcheck/-lvalgrind options wouldn't have worked otherwise. |