| Summary: | Valgrind can't find .so via embedded rpath with $ORIGIN | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Frank Wallingford <frank.wallingford> |
| Component: | general | Assignee: | Julian Seward <jseward> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 2.2.0 | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Starting with (I think) valgrind 2.1.2, valgrind no longer finds shared libraries via the rpath embedded in the executable if it contains a reference to $ORIGIN. Valgrind 2.0 worked, and I've also tested 2.2.0, which does not work. If the embedded path is absolute (does not use $ORIGIN), it works fine. Example: shared.c: int foo() { return 42; } test.c: extern int foo(); int main() { return foo(); } $ cd /tmp $ gcc -shared shared.c -o libshared.so $ gcc test.c -o test -L. -lshared -Wl,-rpath,'$ORIGIN' $ cd ~ $ ldd /tmp/test $ /tmp/test $ valgrind --tool=memcheck /tmp/test My system: $ uname -a Linux topgun 2.6.8-1-mts #8 Mon Aug 16 15:42:31 EDT 2004 i686 Pentium III (Coppermine) unknown GNU/Linux $ valgrind --version valgrind-2.2.0 $ gcc --version gcc (GCC) 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)