|
From: Philippe W. <phi...@sk...> - 2013-03-04 20:24:20
|
On Tue, 2013-03-05 at 03:16 +0800, Lu Mitnick wrote: > Hello everyone, > > > I am new to valgrind and wanna to know the mechanism of function > interception. Valgrind online documentation mentioned the function > interception is implemented via dynamic loader(dlopen/dlsym). I am > curious about whether the mechanism works well or not when the > instrumented program is static linked. You can intercept statically linked functions. I also think that the interception functions can also be part of the statically linked main executable. However, the tools and core Valgrind replacement definitions are in shared objects, which I believe are only properly handled if the dynamic loader is activated. For implementation, see include/pub_tool_redir.h, coregrind/pub_core_redir.h and coregrind/m_redir.c. Philippe |