|
From: Tom H. <th...@cy...> - 2003-09-24 16:15:55
|
In message <9B5...@po...>
Jiafu Gao <JG...@se...> wrote:
>> my_program must rely on at least one shared object.
>
> I want to ask the reverse question: if my_program relies on one
> shared object, will valgrind always work with my_program?
Yes, because in order to rely on a shared library it must be linked
as a dynamic executable with ld-linux.so as the ELF interpreter, which
is what is actually important here.
> The reason for my question is: if the answer is yes, then we can
> come up a way to "remove" (at least in practical sense) this
> requirement. For example:
>
> Ship a dummy shared object, see, vgdummy.so, with valgrind. It
> has one function, see, VG_dummy() which basically does nothing. The
> user program can call VG_dummy() and linked with vgdummy.so, then the
> valgrind will work with the user program. We can make the VG_dummy() as
> a Valgrind MACRO if desired.
Way over the top and completely unnecessary. It's quite simple - if
you want to use valgrind don't link with -static or it won't work.
If you need to link against the static version of a particular library
then explicitly link against the .a instead of the .so for that library
and it will all work.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|