When an ELF executable using rpath to locate its libraries is compressed
with UPX, it will not work anymore.
I've written (and attached) a small example:
$ make
gcc -o lib/libsomelib.so somelib.c -fPIC -shared
gcc -o test test.c -Wl,-rpath,'$ORIGIN'/lib -Llib -lsomelib
$ ldd test
linux-gate.so.1 => (0xb7f87000)
libsomelib.so => /mnt/work/testupx/lib/libsomelib.so (0xb7f84000)
libc.so.6 => /lib/libc.so.6 (0xb7e1f000)
/lib/ld-linux.so.2 (0xb7f88000)
$ ./test
asdaaaaaaaaaaaa...[etc.]
$ upx --best test
Ultimate Packer for eXecutables
Copyright (C)
1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007
UPX 3.02 Markus Oberhumer, Laszlo Molnar & John Reiser Dec 16th
2007
File size Ratio Format Name
-------------------- ------ ----------- -----------
22507 -> 4968 22.07% linux/elf386 test
$ ./test
./test: error while loading shared libraries: libsomelib.so: cannot open
shared object file: No such file or directory
I've attached the test case for this issue.
John Reiser
None
None
Public
|
Date: 2008-05-13 02:20
|
|
Date: 2008-04-28 14:05
|
|
Date: 2008-04-21 14:39
|
| Filename | Description | Download |
|---|---|---|
| testupx.tar.gz | Test for the RPATH issue | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Pending | 2008-05-13 02:20 | sf-robot |
| close_date | 2008-04-28 14:05 | 2008-05-13 02:20 | sf-robot |
| close_date | - | 2008-04-28 14:05 | jreiser |
| resolution_id | None | 2008-04-28 14:05 | jreiser |
| status_id | Open | 2008-04-28 14:05 | jreiser |
| assigned_to | nobody | 2008-04-28 12:53 | mfx |
| File Added | 275350: testupx.tar.gz | 2008-04-21 14:05 | dragonk |