Bug 214569 - command line option --inhibit-rpath to ld-linux.so.2 doesn't work
command line option --inhibit-rpath to ld-linux.so.2 doesn't work
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2006-11-08 07:48 EST by David Juran
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 2.5.90-5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-11-11 03:53:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
test case (239.89 KB, application/x-bzip)
2006-11-08 07:49 EST, David Juran
no flags Details

  None (edit)
Description David Juran 2006-11-08 07:48:36 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20061027 Fedora/ Firefox/

Description of problem:

According to the ld.so(8) man page you should be able to give the command line option --inhibit-rpath to the dynamic linker to have it ignore the rpath section of a binary. Unfortunately it seems that ld-linux.so chooses to ignore the command line option instead...

This can be demonstrated with the attached test case. The attached archive contains a (slightly) modified version of libtiff. If you run the "runme.sh" script, it will build a test program setting rpath to a small library (libfoo) that loads the modified libtiff. So when I run the test program, the modified libtiff is loaded. Fine. 
Then I try with the --inhibit-rpath option, but still libfoo is loaded. I would expect it not be be found.
As a final test I try to inhibit the rpath of my libfoo. Then ld-linux.so.2 segfaults...

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. upnpack the attached archive and run runme.sh

Actual Results:

Expected Results:

Additional info:
Comment 1 David Juran 2006-11-08 07:49:52 EST
Created attachment 140646 [details]
test case
Comment 2 Jakub Jelinek 2006-11-08 10:30:47 EST
Sorry, I was mistaken with what should be given to ignore the main program's
RPATH.  It is an empty string, not its filename.
So, /lib/ld-linux.so.2 --inhibit-rpath '' ./test
resp. /lib/ld-linux.so.2 --inhibit-rpath :lib1/libfoo.so ./test
inhibit RPATH from ./test resp. ./test and lib1/libfoo.so objects.
The segfault is a bug, I posted a fix today:
Comment 3 Jakub Jelinek 2006-11-11 03:53:39 EST
Should be fixed in glibc-2.5.90-5 and above in rawhide.

Note You need to log in before you can comment on or make changes to this bug.