|
From: Samuel Q. <Sam...@sy...> - 2014-01-14 15:14:53
|
Greetings,
I invoke my program as follows:
LD_PRELOAD=./libfakec.so ./my_app –e
The LD_PRELOAD environment variable tells the loader that libfakec.so should be loaded BEFORE every other library including the C runtime, libc.so (see http://stackoverflow.com/questions/426230/what-is-the-ld-preload-trick, for example). I am substituting some of my own routines for standard library calls. My app is working like I want, but the question is how to run the app under valgrind? I tried this:
valgrind LD_PRELOAD=./libfakec.so ./my_app –e
But valgrind gave and error saying that "LD_PRELOAD=./libfakec.so ./my_app –e" is not a valid path. In theory, I could put the LD_PRELOAD before the valgrind invocation:
LD_PRELOAD=./libfakec.so valgrind ./my_app –e
But then valgrind would also be using my special library routines and I am pretty sure that will not work.
Is there a way around this? I am running on CentOS 6.5.
-Sam
PS: I tried to figure out how to search the archives of this mailing list for LD_PRELOAD, but I could not see a way.
|