fix lots of breakage on dlopen, mostly with explicit pathnames
authorRich Felker <dalias@aerifal.cx>
Wed, 11 Jul 2012 05:41:20 +0000 (01:41 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 11 Jul 2012 05:41:20 +0000 (01:41 -0400)
commit0420b874465db7544a9e1f320969b4920c9405d8
treea6685f74c0ae8dd478a300533c3054516d7f121a
parentbd1cf09c375e56c7fba6b7a1036b33b9591b5dba
fix lots of breakage on dlopen, mostly with explicit pathnames

most importantly, the name for such libs was being set from an
uninitialized buffer. also, shortname always had an initial '/'
character, making it useless for looking up already-loaded libraries
by name, and thus causing repeated searches through the library path.

major changes now:

- shortname is the base name for library lookups with no explicit
  pathname. it's initially clear for libraries loaded with an explicit
  pathname (and for the main program), but will be set if the same
  library (detected via inodes match) is later found by a search.

- exact name match is never used to identify libraries loaded with an
  explicit pathname. in this case, there's no explicit search, so we
  can just stat the file and check for inode match.
src/ldso/dynlink.c