[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/10250] New: RPATH $ORIGIN doesn't work if resulting path has col
From: |
trick at icculus dot org |
Subject: |
[Bug ld/10250] New: RPATH $ORIGIN doesn't work if resulting path has colons in it |
Date: |
6 Jun 2009 23:43:59 -0000 |
Summary says it all, really. As an example, try this (make a
new directory for it to run in and make sure the path doesn't contain colons):
#!/bin/sh
echo 'void foo (void) {}' >foo.c
echo 'void foo (void); int main (int argc, char *argv[]) { foo(); return 0; }'
>test.c
gcc -shared foo.c -o libfoo.so
gcc -Wl,-rpath,'$ORIGIN' test.c -L. -lfoo -o test
mkdir 'this:breaks:rpath' 'this:breaks:rpath/subdir'
cp libfoo.so test this:breaks:rpath
cp libfoo.so test this:breaks:rpath/subdir
echo '=== current directory (no colons) ==='
ls
./test
ldd test
cd this:breaks:rpath
echo '=== directory with colons ==='
ls
./test
ldd test
cd subdir
echo '=== subdirectory in path with colons ==='
ls
./test
ldd test
Results (I ran the script in /tmp/a):
=== current directory (no colons) ===
foo.c libfoo.so test test.c test.sh this:breaks:rpath
linux-vdso.so.1 => (0x00007fffc3bff000)
libfoo.so => /tmp/a/libfoo.so (0x00007f48bb73c000)
libc.so.6 => /lib/libc.so.6 (0x00007f48bb3e7000)
/lib/ld-linux-x86-64.so.2 (0x00007f48bb93d000)
=== directory with colons ===
libfoo.so subdir test
./test: error while loading shared libraries: libfoo.so: cannot open shared
object file: No such file or directory
linux-vdso.so.1 => (0x00007fffc59ff000)
libfoo.so => not found
libc.so.6 => /lib/libc.so.6 (0x00007fe1bd301000)
/lib/ld-linux-x86-64.so.2 (0x00007fe1bd656000)
=== subdirectory in path with colons ===
libfoo.so test
./test: error while loading shared libraries: libfoo.so: cannot open shared
object file: No such file or directory
linux-vdso.so.1 => (0x00007fff509fe000)
libfoo.so => not found
libc.so.6 => /lib/libc.so.6 (0x00007f3c48471000)
/lib/ld-linux-x86-64.so.2 (0x00007f3c487c6000)
Tested on 64-bit system (Arch Linux) with binutils 2.19.1 (above), and also on
a
32-bit system (Gentoo Linux) with binutils 2.17. Same results on both.
--
Summary: RPATH $ORIGIN doesn't work if resulting path has colons
in it
Product: binutils
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: trick at icculus dot org
CC: bug-binutils at gnu dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=10250
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/10250] New: RPATH $ORIGIN doesn't work if resulting path has colons in it,
trick at icculus dot org <=
- [Bug ld/10250] RPATH $ORIGIN doesn't work if resulting path has colons in it, trick at icculus dot org, 2009/06/06
- [Bug ld/10250] RPATH $ORIGIN doesn't work if resulting path has colons in it, trick at icculus dot org, 2009/06/06
- [Bug ld/10250] RPATH $ORIGIN doesn't work if resulting path has colons in it, trick at icculus dot org, 2009/06/06
- [Bug ld/10250] RPATH $ORIGIN doesn't work if resulting path has colons in it, schwab at linux-m68k dot org, 2009/06/07
- [Bug ld/10250] RPATH $ORIGIN doesn't work if resulting path has colons in it, trick at icculus dot org, 2009/06/08
- [Bug ld/10250] RPATH $ORIGIN doesn't work if resulting path has colons in it, trick at icculus dot org, 2009/06/08