I am attempting to run my program, which requires a library to be in the
LD_PRELOAD
environment variable, with valgrind. When I do this I get the
following error:
ERROR: ld.so: object '/path/to/lib/libLIBRARY.so' from LD_PRELOAD cannot
be preloaded: ignored.
However, if I am to run the program WITHOUT valgrind, it happily uses the
LD_PRELOAD
ed library.
Why is this the case? And is there a way to fix it?
(P.S. The system is 64-bit scientific linux 5, I believe)
This can happen if valgrind is 64-bit, and both the shared library and the application are 32-bit. valgrind itself can't load the library, but it should load for the application itself.
Edit: Oh, and ... you really shouldn't be using LD_PRELOAD for required libraries for your own programs, only for debugging or otherwise overriding libraries. Instead, embed an rpath/runpath in the executable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With