This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

more 2.1 changes


Hi,

I've checked in a patch to ld.so which Roland does not like but I
think is important and very useful.  It's not invented by me, this is
implemented in most recent Solaris' versions.

If you now use $ORIGIN in an RPATH or in DT_NEEDED or a fileter name
or... the RPATH is determined based on where the binary is installed.
Assume RPATH of `program' set ot $ORIGIN/../lib and a DT_NEEDED libfoo.so:

	/foo/bar/bin/program
	/foo/bar/lib/libfoo.so

Starting program (which is effectively /foo/bar/bin/program) allows
the ld.so to expand $ORIGIN to /foo/bar/bin and so the final RPATH is
/foo/bar/bin/../lib and magically ld.so finds the libfoo.so.

The whole thing is even more exciting when you see that now the bin
and lib subdirs can be moved to another place and it still works.


There is a problem with this: the solution implemented works only on
Linux 2.1 (and other modern kernels).  It does not work with Linux 2.0
and Hurd.  To work around this limitation the user optionally can
specify (for the above example)

	LD_ORIGIN_PATH=/foo/bar/bin

and this will lead to the same result as if this value would have been
determined automatically.


One other change I checked in fixes the invalid asm's I used in
LinuxThreads.  This caused the compiler to crash.  The problem was an
errorneous comment which mislead me.  In fact there is no clean way to
implement what I need so I use yet another ugly hack.  Still the code
is AFAIK not working correctly.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]