This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Why does $LIB not work on Ubuntu?
- From: Florian Weimer <fweimer at bfk dot de>
- To: Adam Kellas <adam dot kellas at gmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Thu, 04 Aug 2011 08:16:38 +0000
- Subject: Re: Why does $LIB not work on Ubuntu?
- References: <CAJty3Zyzx7DZxeLXom6A3wMzQxQhzXnrt4Z0MFtwwukwSTJFow@mail.gmail.com>
* Adam Kellas:
> I have an application which makes use of LD_PRELOAD and I recently
> discovered how to make it work with either 32- or 64-bit programs by
> using the dynamic string token '$LIB' in the path. According to Ulrich
> Drepper's document
> http://www.akkadia.org/drepper/dsohowto.pdf, $LIB will expand to
> "/lib" for a 32-bit process and /lib64 for a 64-bit process, they
> enabling me to maintain both flavors and find the appropriate one in
> all cases. I implemented this in my code and it works great. Problem
> solved.
I'm pretty sure that at least on some Ubuntu versions, /lib64 is a
symlink to /lib. Then $LIB will not work as expected.
--
Florian Weimer <fweimer@bfk.de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99